Repository navigation
feat: Adds migrate --repair command to CLI. - #980
Merged
Merged
Conversation
Isakdl
approved these changes
Jun 1, 2023
Isakdl
left a comment
Collaborator
There was a problem hiding this comment.
Some NIT comments.
Would be nice with a test too! But otherwise looking good.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 adds a repair option to the
serverpod migratecommand.Example usage:
serverpod migrate --repair --mode productionThe command will connect to the insights server and retrieve the structure of the database. The structure is compared with what is expected from the most up-to-date migrations (including modules). If the database is out of sync, the command will output the SQL queries required to synchronize the database with the latest migration. If any destructive changes are detected, warnings will be written and the
--forceoption will need to be added to output the SQL code.Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
If you have done any breaking changes, make sure to outline them here, so that they can be included in the notes for the next release.