Warn when migration was inferred as non-reversible and user set rever…#3597
Closed
kyle-leonhard wants to merge 1 commit into
Closed
Warn when migration was inferred as non-reversible and user set rever…#3597kyle-leonhard wants to merge 1 commit into
kyle-leonhard wants to merge 1 commit into
Conversation
Collaborator
|
This is a bug. The command-line flag should always override the inferred behavior. I have a fix in #3383 but it's going to take me some time yet to get that over the finish line. I'm going to close this since it's the wrong approach, but please feel free to open a new PR with the bugfix. |
Author
Thank you very much, @abonander |
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 prints a warning when trying to add a reversible migration on top of non-reversible migrations. This behavior was added along with the PR that added inference: #2664.
First time contributor here - I read the code and it's not clear why reversible migrations can't be stacked on top of non-reversible ones. Obviously this would limit which versions one could revert, which seems fine.
I'm in the spot where I was lazy in the beginning of a project and used non-reversible migrations. But now I'd like to start using reversible ones.
Does your PR solve an issue?
Running
sqlx migrate add -r somethingafter previously adding non-reversible migrations ignores the-rflag and creates a non-reversible migration. I was confused for a bit.#3598