[legacy-framework] Prevent blitz db migrate from attempting to create new migration files in production#683
Merged
flybayer merged 3 commits intoblitz-js:canaryfrom Jun 16, 2020
Conversation
flybayer
requested changes
Jun 15, 2020
Member
flybayer
left a comment
There was a problem hiding this comment.
@toshi1127 thank you so much for this!!
Looks good except for the flipped if/else :)
Comment on lines
+56
to
+69
| if (process.env.NODE_ENV === 'production') { | ||
| const cp = spawn(prismaBin, ['migrate', 'save', schemaArg, '--create-db', '--experimental'], { | ||
| stdio: 'inherit', | ||
| }) | ||
| cp.on('exit', (code) => { | ||
| if (code === 0) { | ||
| runMigrateUp(prismaBin, resolve) | ||
| } else { | ||
| process.exit(1) | ||
| } | ||
| }) | ||
| } else { | ||
| runMigrateUp(prismaBin, resolve) | ||
| } |
Member
There was a problem hiding this comment.
This logic is backward. In production only up should run. Otherwise both save and up should run.
blitz db migrate from attempting to create new migration files in production
Collaborator
Author
Member
|
Woohoo! Thanks :) @all-contributors add @toshi1127 for code |
|
I've put up a pull request to add @toshi1127! 🎉 |
blitz db migrate from attempting to create new migration files in productionblitz db migrate from attempting to create new migration files in production
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes the issue of Prevent
blitz db migratefrom attempting to create new migration files in production. #670What are the changes and their implications?
blitz db migratefrom attempting to create new migration files in production.Checklist