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

Commit a8497312 by Sascha Depold

first steps for migrations

1 parent 1ebef999
var fs = require("fs")
, path = require("path")
, Utils = require("./utils")
module.exports = (function() {
var Migrator = function(options) {
this.options = Utils._.extend({
path: __dirname + '/../migrations',
from: null,
to: null
}, _options || {})
}, options || {})
}
Migrator.prototype.migrate = function() {
getLastMigrationId.call(this)
}
// private
var getLastMigrationId = function() {
var result = null
fs.readdirSync(this.options.path).filter(function(file) {
console.log(file)
})
}
return Migrator
......
module.exports = {
up: function() {
},
down: function() {
}
}
var config = require("./config/config")
, Sequelize = require("../index")
, sequelize = new Sequelize(config.database, config.username, config.password, { logging: false })
, Helpers = new (require("./config/helpers"))(sequelize)
, Migrator = require("../lib/migrator")
describe('Migrator', function() {
describe('getLastMigrationId', function() {
it("should correctly transform array into IN", function() {
new Migrator({ path: __dirname + '/assets/migrations'}).migrate()
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!