diff options
Diffstat (limited to 'scripts/danger/clean/cleaner.js')
-rw-r--r-- | scripts/danger/clean/cleaner.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/danger/clean/cleaner.js b/scripts/danger/clean/cleaner.js index a63c478e0..3d364fd23 100644 --- a/scripts/danger/clean/cleaner.js +++ b/scripts/danger/clean/cleaner.js | |||
@@ -1,12 +1,13 @@ | |||
1 | const rimraf = require('rimraf') | 1 | const rimraf = require('rimraf') |
2 | const mongoose = require('mongoose') | 2 | const mongoose = require('mongoose') |
3 | mongoose.Promise = global.Promise | ||
3 | 4 | ||
4 | const constants = require('../../../server/initializers/constants') | 5 | const constants = require('../../../server/initializers/constants') |
5 | 6 | ||
6 | const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME | 7 | const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME |
7 | mongoose.connect(mongodbUrl, function () { | 8 | mongoose.connect(mongodbUrl, function () { |
8 | console.info('Deleting MongoDB %s database.', constants.CONFIG.DATABASE.DBNAME) | 9 | console.info('Deleting MongoDB %s database.', constants.CONFIG.DATABASE.DBNAME) |
9 | mongoose.connection.db.dropDatabase(function () { | 10 | mongoose.connection.dropDatabase(function () { |
10 | mongoose.connection.close() | 11 | mongoose.connection.close() |
11 | }) | 12 | }) |
12 | }) | 13 | }) |