Warn when migration was inferred as non-reversible and user set rever… #3597
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 something
after previously adding non-reversible migrations ignores the-r
flag and creates a non-reversible migration. I was confused for a bit.#3598