Skip to content

Commit

Permalink
Use isSilent flag in SQL migration templates
Browse files Browse the repository at this point in the history
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 <gadgetmies@gmail.com>
  • Loading branch information
gadgetmies committed Nov 29, 2022
1 parent 1f20efc commit d040c41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Template.prototype.sqlFileLoaderTemplate = function () {
' return new Promise( function( resolve, reject ) {',
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
' if (err) return reject(err);',
" console.log('received data: ' + data);",
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
'',
' resolve(data);',
' });',
Expand All @@ -122,7 +122,7 @@ Template.prototype.sqlFileLoaderTemplate = function () {
' return new Promise( function( resolve, reject ) {',
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
' if (err) return reject(err);',
" console.log('received data: ' + data);",
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
'',
' resolve(data);',
' });',
Expand Down Expand Up @@ -171,7 +171,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
' return new Promise( function( resolve, reject ) {',
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
' if (err) return reject(err);',
" console.log('received data: ' + data);",
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
'',
' resolve(data);',
' });',
Expand All @@ -181,7 +181,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
' });',
' }',
' else {',
" console.log('ignoring on init: ' + filePath)",
" if (db.log.isSilent !== true) console.log('ignoring on init: ' + filePath)",
' return null;',
' }',
'};',
Expand All @@ -193,7 +193,7 @@ Template.prototype.sqlFileLoaderIgnoreOnInitTemplate = function () {
' return new Promise( function( resolve, reject ) {',
" fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){",
' if (err) return reject(err);',
" console.log('received data: ' + data);",
" if (db.log.isSilent !== true) console.log('received data: ' + data);",
'',
' resolve(data);',
' });',
Expand Down

0 comments on commit d040c41

Please sign in to comment.