aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/danger
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/danger')
-rw-r--r--scripts/danger/clean/cleaner.js3
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 @@
1const rimraf = require('rimraf') 1const rimraf = require('rimraf')
2const mongoose = require('mongoose') 2const mongoose = require('mongoose')
3mongoose.Promise = global.Promise
3 4
4const constants = require('../../../server/initializers/constants') 5const constants = require('../../../server/initializers/constants')
5 6
6const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME 7const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME
7mongoose.connect(mongodbUrl, function () { 8mongoose.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})