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

Commit 622e1e33 by Ben Evans

Make available migrator helpers

This has been done so other tools can interact with the current migration state and more advanced tooling for migrating.
1 parent 27dbf0fd
Showing with 6 additions and 6 deletions
......@@ -233,7 +233,7 @@ module.exports = (function() {
// private
var getLastMigrationFromDatabase = function() {
var getLastMigrationFromDatabase = Migrator.prototype.getLastMigrationFromDatabase = function() {
var self = this
return new Utils.CustomEventEmitter(function(emitter) {
......@@ -255,7 +255,7 @@ module.exports = (function() {
}).run()
}
var getLastMigrationIdFromDatabase = function() {
var getLastMigrationIdFromDatabase = Migrator.prototype.getLastMigrationIdFromDatabase = function() {
var self = this
return new Utils.CustomEventEmitter(function(emitter) {
......@@ -270,7 +270,7 @@ module.exports = (function() {
}).run()
}
var getFormattedDateString = function(s) {
var getFormattedDateString = Migrator.prototype.getFormattedDateString = function(s) {
var result = null
try {
......@@ -282,11 +282,11 @@ module.exports = (function() {
return result
}
var stringToDate = function(s) {
var stringToDate = Migrator.prototype.stringToDate = function(s) {
return moment(getFormattedDateString(s), "YYYYMMDDHHmmss")
}
var saveSuccessfulMigration = function(from, to, callback) {
var saveSuccessfulMigration = Migrator.prototype.saveSuccessfulMigration = function(from, to, callback) {
var self = this
self.findOrCreateSequelizeMetaDAO().success(function(SequelizeMeta) {
......@@ -296,7 +296,7 @@ module.exports = (function() {
})
}
var deleteUndoneMigration = function(from, to, callback) {
var deleteUndoneMigration = Migrator.prototype.deleteUndoneMigration = function(from, to, callback) {
var self = this
self.findOrCreateSequelizeMetaDAO().success(function(SequelizeMeta) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!