1 import * as eachSeries from 'async/eachSeries'
2 import * as rimraf from 'rimraf'
4 import { CONFIG } from '../../../server/initializers/constants'
5 import { database as db } from '../../../server/initializers/database'
7 db.init(true, function () {
8 db.sequelize.drop().asCallback(function (err) {
11 console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME)
13 const STORAGE = CONFIG.STORAGE
14 eachSeries(Object.keys(STORAGE), function (storage, callbackEach) {
15 const storageDir = STORAGE[storage]
17 rimraf(storageDir, function (err) {
18 console.info('%s deleted.', storageDir)
19 return callbackEach(err)