From 7fc4cc8881a0a364767832b4edf47aea5aa79b0b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Nov 2016 22:40:33 +0100 Subject: Server: fix db clean for clean script --- scripts/danger/clean/cleaner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 @@ const rimraf = require('rimraf') const mongoose = require('mongoose') +mongoose.Promise = global.Promise const constants = require('../../../server/initializers/constants') const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME mongoose.connect(mongodbUrl, function () { console.info('Deleting MongoDB %s database.', constants.CONFIG.DATABASE.DBNAME) - mongoose.connection.db.dropDatabase(function () { + mongoose.connection.dropDatabase(function () { mongoose.connection.close() }) }) -- cgit v1.2.3