aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-14 22:40:33 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit7fc4cc8881a0a364767832b4edf47aea5aa79b0b (patch)
treed6b7afa216f9bccda42d10e2d27ba7990ef9a0ad
parenta4254ea1738d3b963fd4ccb995ab63f70656d6c0 (diff)
downloadPeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.tar.gz
PeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.tar.zst
PeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.zip
Server: fix db clean for clean script
-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})