不要怂,就是干,撸起袖子干!

Commit 8e0f224d by Sascha Depold

use clear database from master

1 parent 1b98f2a4
Showing with 8 additions and 21 deletions
......@@ -63,27 +63,14 @@ var Support = {
},
clearDatabase: function(sequelize, callback) {
var disablequery = sequelize.getQueryInterface().QueryGenerator.disableForeignKeyConstraintsQuery()
, dropAll = function (cb) {
return function () {
sequelize
.getQueryInterface()
.dropAllTables()
.success(function() {
sequelize.daoFactoryManager.daos = []
cb && cb()
})
.error(function(err) { console.log("Error clearing database " + err) })
}
}
if (disablequery) {
sequelize.query(disablequery).success(dropAll(function () {
sequelize.query(sequelize.getQueryInterface().QueryGenerator.enableForeignKeyConstraintsQuery()).success(callback)
}))
} else {
dropAll(callback)()
}
sequelize
.getQueryInterface()
.dropAllTables()
.success(function() {
sequelize.daoFactoryManager.daos = []
callback && callback()
})
.error(function(err) { console.log(err) })
},
getSupportedDialects: function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!