Skip to content

Commit 49d8664

Browse files
committed
Activaitng the --ignore-on-init also on the up operation
1 parent b6791f7 commit 49d8664

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/migration.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ Migration.prototype.sqlFileLoaderIgnoreOnInitTemplate = function() {
161161
"var seed;",
162162
"var fs = require('fs');",
163163
"var path = require('path');",
164+
"var ignoreOnInit = false;",
164165

165166

166167
"",
@@ -170,14 +171,15 @@ Migration.prototype.sqlFileLoaderIgnoreOnInitTemplate = function() {
170171
" */",
171172
"exports.setup = function(options, seedLink) {",
172173
" dbm = options.dbmigrate;",
174+
" ignoreOnInit = dbm.getInstance().internals.argv['ignore-on-init']",
173175
" type = dbm.dataType;",
174176
" seed = seedLink;",
175177
"};",
176178
"",
177179
"exports.up = function(db, callback) {",
178180
" var filePath = path.join(__dirname + '/sqls/" + this.name.replace(
179181
'.js', '') + "-up.sql');",
180-
" if (!dbm.ignoreInit) {",
182+
" if (!ignoreOnInit) {",
181183
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
182184
" if (err) return callback(err);",
183185
" console.log('received data: ' + data);",

0 commit comments

Comments
 (0)