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

Commit 8e0f224d by Sascha Depold

use clear database from master

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