]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: fix db clean for clean script
authorChocobozzz <florian.bigard@gmail.com>
Mon, 14 Nov 2016 21:40:33 +0000 (22:40 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Wed, 16 Nov 2016 19:29:26 +0000 (20:29 +0100)
scripts/danger/clean/cleaner.js

index a63c478e035f4b017b78c8cc1f7b30648c8c69c0..3d364fd23e57f6f5278423c8ac4a9de03178a41b 100644 (file)
@@ -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()
   })
 })