db-migrate
Advanced tools
Comparing version 0.10.0-beta.13 to 0.10.0-beta.14
83
api.js
@@ -90,3 +90,3 @@ var assert = require('assert'); | ||
process.on('unhandledRejection', function(reason, promise) { | ||
process.on('unhandledRejection', function(reason) { | ||
log.error(reason.stack); | ||
@@ -163,3 +163,3 @@ process.exit(1); | ||
*/ | ||
up: function(specification, scope, callback) { | ||
up: function(specification, opts, callback) { | ||
@@ -174,10 +174,21 @@ if (arguments.length > 0) { | ||
} | ||
else if (typeof(specification) === 'function') { | ||
if (scope) { | ||
callback = specification; | ||
} | ||
this.internals.migrationMode = scope; | ||
if (typeof(opts) === 'string') { | ||
this.internals.migrationMode = opts; | ||
} | ||
else if (typeof(opts) === 'function') { | ||
callback = opts; | ||
} | ||
} | ||
executeUp(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeUp(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -190,17 +201,28 @@ | ||
*/ | ||
down: function(specification, scope, callback) { | ||
down: function(specification, opts, callback) { | ||
if (arguments.length > 0) { | ||
if (typeof(arguments[0]) === 'number') { | ||
if (typeof(specification) === 'number') { | ||
this.internals.argv.count = arguments[0]; | ||
} | ||
else if (typeof(specification) === 'function') { | ||
if (scope) { | ||
callback = specification; | ||
} | ||
this.internals.migrationMode = scope; | ||
if (typeof(opts) === 'string') { | ||
this.internals.migrationMode = opts; | ||
} | ||
else if (typeof(opts) === 'function') { | ||
callback = opts; | ||
} | ||
} | ||
executeDown(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeDown(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -213,9 +235,16 @@ | ||
if (scope) { | ||
if (typeof(scope) === 'string') { | ||
this.internals.migrationMode = scope; | ||
} | ||
else if(typeof(scope) === 'function') { | ||
callback = scope; | ||
} | ||
this.internals.argv.count = Number.MAX_VALUE; | ||
executeDown(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeDown(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -245,3 +274,6 @@ | ||
this.internals.argv._.push(migrationName); | ||
executeCreateMigration(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeCreateMigration(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -256,3 +288,6 @@ | ||
this.internals.mode = 'create'; | ||
executeDB(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeDB(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -267,3 +302,6 @@ | ||
this.internals.mode = 'drop'; | ||
executeDB(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeDB(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -311,3 +349,6 @@ | ||
this.internals.mode = mode || 'vc'; | ||
executeSeed(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeSeed(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -335,3 +376,6 @@ | ||
executeUndoSeed(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeUndoSeed(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -360,3 +404,6 @@ | ||
this.internals.argv.count = Number.MAX_VALUE; | ||
executeUndoSeed(this.internals, this.config, callback); | ||
return Promise.fromCallback(function(callback) { | ||
executeUndoSeed(this.internals, this.config, callback); | ||
}.bind(this)).asCallback(callback); | ||
}, | ||
@@ -363,0 +410,0 @@ |
@@ -42,4 +42,3 @@ /** | ||
var params = arguments, | ||
self = this, | ||
callback; | ||
self = this; | ||
@@ -46,0 +45,0 @@ return self._shadowProto[property].apply(self, params) |
@@ -34,3 +34,3 @@ { | ||
], | ||
"version": "0.10.0-beta.13", | ||
"version": "0.10.0-beta.14", | ||
"engines": { | ||
@@ -37,0 +37,0 @@ "node": ">=0.6.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115206
2960