diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-14 22:40:33 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | 7fc4cc8881a0a364767832b4edf47aea5aa79b0b (patch) | |
tree | d6b7afa216f9bccda42d10e2d27ba7990ef9a0ad /scripts/danger/clean | |
parent | a4254ea1738d3b963fd4ccb995ab63f70656d6c0 (diff) | |
download | PeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.tar.gz PeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.tar.zst PeerTube-7fc4cc8881a0a364767832b4edf47aea5aa79b0b.zip |
Server: fix db clean for clean script
Diffstat (limited to 'scripts/danger/clean')
-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 | }) |