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

You need to sign in or sign up before continuing.
Commit dca14ce1 by Sascha Depold

prepare associations before syncing with database

1 parent 1b5f45fa
Showing with 5 additions and 1 deletions
...@@ -64,7 +64,11 @@ Sequelize.prototype = { ...@@ -64,7 +64,11 @@ Sequelize.prototype = {
var finished = [] var finished = []
var tables = this.tables var tables = this.tables
SequelizeHelper.Hash.forEach(tables, function(table, tableName) { SequelizeHelper.Hash.forEach(tables, function(table) {
table.constructor.prepareAssociations()
})
SequelizeHelper.Hash.forEach(tables, function(table) {
table.constructor.sync(function() { table.constructor.sync(function() {
finished.push(true) finished.push(true)
if(finished.length == SequelizeHelper.Hash.keys(tables).length) if(finished.length == SequelizeHelper.Hash.keys(tables).length)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!