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

Commit c0d6ee1b by Joe Lutz

Update migrator logging

1 parent 491192f9
Showing with 5 additions and 5 deletions
...@@ -45,9 +45,9 @@ module.exports = (function() { ...@@ -45,9 +45,9 @@ module.exports = (function() {
} }
if (migrations.length === 0) { if (migrations.length === 0) {
self.sequelize.log('There are no pending migrations.'); self.options.logging('There are no pending migrations.');
} else { } else {
self.sequelize.log('Running migrations...'); self.options.logging('Running migrations...');
} }
migrations.forEach(function(migration) { migrations.forEach(function(migration) {
...@@ -55,7 +55,7 @@ module.exports = (function() { ...@@ -55,7 +55,7 @@ module.exports = (function() {
chainer.add(migration, 'execute', [options], { chainer.add(migration, 'execute', [options], {
before: function(migration) { before: function(migration) {
self.sequelize.log(migration.filename); self.options.logging(migration.filename);
migrationTime = process.hrtime(); migrationTime = process.hrtime();
}, },
...@@ -63,7 +63,7 @@ module.exports = (function() { ...@@ -63,7 +63,7 @@ module.exports = (function() {
migrationTime = process.hrtime(migrationTime); migrationTime = process.hrtime(migrationTime);
migrationTime = Math.round((migrationTime[0] * 1000) + (migrationTime[1] / 1000000)); migrationTime = Math.round((migrationTime[0] * 1000) + (migrationTime[1] / 1000000));
self.sequelize.log('Completed in ' + migrationTime + 'ms'); self.options.logging('Completed in ' + migrationTime + 'ms');
}, },
success: function(migration, callback) { success: function(migration, callback) {
...@@ -194,7 +194,7 @@ module.exports = (function() { ...@@ -194,7 +194,7 @@ module.exports = (function() {
var addMigration = function(filename) { var addMigration = function(filename) {
var migration = new Migration(self, filename); var migration = new Migration(self, filename);
self.sequelize.log('Adding migration script at ' + filename); self.options.logging('Adding migration script at ' + filename);
chainer.add(migration, 'execute', [{ method: 'up' }], { chainer.add(migration, 'execute', [{ method: 'up' }], {
before: function(migration) { before: function(migration) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!