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

Commit f293a111 by Martin Aspeli

Create tables in dependency order

1 parent 556a6639
Showing with 6 additions and 3 deletions
......@@ -261,11 +261,14 @@ module.exports = (function() {
var chainer = new Utils.QueryChainer()
this.daoFactoryManager.daos.forEach(function(dao) {
chainer.add(dao.sync(options))
// Topologically sort by foreign key constraints to give us an appropriate
// creation order
this.daoFactoryManager.forEachDAO(function(dao) {
chainer.add(dao, 'sync', [options])
})
return chainer.run()
return chainer.runSerially()
}
Sequelize.prototype.drop = function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!