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

Commit 74831550 by sdepold

minor refactoring

1 parent f86025b4
Showing with 7 additions and 5 deletions
...@@ -21,9 +21,11 @@ module.exports = (function() { ...@@ -21,9 +21,11 @@ module.exports = (function() {
var self = this var self = this
return new Utils.CustomEventEmitter(function(emitter) { return new Utils.CustomEventEmitter(function(emitter) {
self.getUndoneMigrations(function(migrations) { self.getUndoneMigrations(function(migrationFiles) {
migrationFiles.each(function() {
self.executeMigration()
})
emitter.emit('success') emitter.emit('success')
console.log(migrations)
}) })
}).run() }).run()
} }
...@@ -101,13 +103,13 @@ module.exports = (function() { ...@@ -101,13 +103,13 @@ module.exports = (function() {
}).run() }).run()
} }
// private Migrator.prototype.executeMigration = function(path, method) {
var executeMigration = function(path, method) {
var migration = require(path) var migration = require(path)
migration[method || 'up'](this.queryInterface, DataTypes) migration[method || 'up'](this.queryInterface, DataTypes)
} }
// private
var getLastMigrationIdFromDatabase = function() { var getLastMigrationIdFromDatabase = function() {
var self = this var self = this
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!