Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isSilent flag in SQL migration templates #805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gadgetmies
Copy link

Previously setting the db-migrate instance isSilent flag did not prevent the printing of the SQL migration files. This caused a huge amount of noise in the output and there was no way to prevent this when calling the up()-function. If you wanted to prevent logging, you would either have to disable those completely by removing the console.log calls, implement your own logic for the logging or do what I did in this PR i.e. modify the code in the template to only log the SQL if the isSilent flag is not set.

Although it would be better to have the log function available also in the migration scripts in order to better control the amount of logging, AFAICT doing so would need a larger change. I'm sure many users would still appreciate having even the use of isSilent in the templates by default.

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>
@gadgetmies gadgetmies force-pushed the use-is-silent-in-sql-template branch from 30ba2da to d040c41 Compare November 29, 2022 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant