Skip to content

Commit d040c41

Browse files
committed
Use isSilent flag in SQL migration templates
Previously setting the db-migrate instance isSilent flag did not prevent the printing of the SQL migration files This causes a huge amount of noise in the output and there was no way to prevent this when calling the up()-function. Signed-off-by: Gadgetmies <[email protected]>
1 parent 1f20efc commit d040c41

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/template.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Template.prototype.sqlFileLoaderTemplate = function () {
105105
' return new Promise( function( resolve, reject ) {',
106106
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
107107
' if (err) return reject(err);',
108-
" console.log('received data: ' + data);",
108+
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
109109
'',
110110
' resolve(data);',
111111
' });',
@@ -122,7 +122,7 @@ Template.prototype.sqlFileLoaderTemplate = function () {
122122
' return new Promise( function( resolve, reject ) {',
123123
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
124124
' if (err) return reject(err);',
125-
" console.log('received data: ' + data);",
125+
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
126126
'',
127127
' resolve(data);',
128128
' });',
@@ -171,7 +171,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
171171
' return new Promise( function( resolve, reject ) {',
172172
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
173173
' if (err) return reject(err);',
174-
" console.log('received data: ' + data);",
174+
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
175175
'',
176176
' resolve(data);',
177177
' });',
@@ -181,7 +181,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
181181
' });',
182182
' }',
183183
' else {',
184-
" console.log('ignoring on init: ' + filePath)",
184+
" if (db.log.isSilent !== true) console.log('ignoring on init: ' + filePath)",
185185
' return null;',
186186
' }',
187187
'};',
@@ -193,7 +193,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
193193
' return new Promise( function( resolve, reject ) {',
194194
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
195195
' if (err) return reject(err);',
196-
" console.log('received data: ' + data);",
196+
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
197197
'',
198198
' resolve(data);',
199199
' });',

0 commit comments

Comments
 (0)