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

Commit f6ace28f by sdepold

allow disabling of logging in migrator

1 parent 87b6c24d
Showing with 6 additions and 3 deletions
...@@ -12,7 +12,8 @@ module.exports = (function() { ...@@ -12,7 +12,8 @@ module.exports = (function() {
this.options = Utils._.extend({ this.options = Utils._.extend({
path: __dirname + '/../migrations', path: __dirname + '/../migrations',
from: null, from: null,
to: null to: null,
logging: true
}, options || {}) }, options || {})
} }
...@@ -42,10 +43,12 @@ module.exports = (function() { ...@@ -42,10 +43,12 @@ module.exports = (function() {
migrations.forEach(function(migration) { migrations.forEach(function(migration) {
chainer.add(migration, 'execute', [options], { chainer.add(migration, 'execute', [options], {
before: function(migration) { before: function(migration) {
console.log('Executing migration: ' + migration.filename) if(self.options.logging)
console.log('Executing migration: ' + migration.filename)
}, },
after: function(migration) { after: function(migration) {
console.log('Executed migration: ' + migration.filename) if(self.options.logging)
console.log('Executed migration: ' + migration.filename)
}, },
success: function(migration, callback) { success: function(migration, callback) {
saveSuccessfulMigration.call(self, migrations[0], migration, callback) saveSuccessfulMigration.call(self, migrations[0], migration, callback)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!