This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
fix: restore previous api rules when downgrading migration - #3192
Merged
Merged
Conversation
ganigeorgiev
suggested changes
Aug 25, 2023
ganigeorgiev
left a comment
Member
There was a problem hiding this comment.
Thanks, looks a lot better this way, I don't know why I've implemented it with the messy if/elseif checks.
I left one minor note about the test. Once done, I think it can be merged.
impact-merlinzerbe
force-pushed
the
master
branch
from
August 25, 2023 13:15
c14e6dc to
7f1e23c
Compare
impact-merlinzerbe
force-pushed
the
master
branch
from
August 25, 2023 13:17
7f1e23c to
0528d85
Compare
Member
|
Thanks! To avoid the back-and-forth I'll merge it with the latest pushed change and will update only the test to include also the other rule fields for slightly better coverage. |
ahmed-khaire
pushed a commit
to ahmed-khaire/postgresbase
that referenced
this pull request
Aug 7, 2024
…ld rules state Co-authored-by: Merlin Marek <[email protected]>
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.
When changing api rules, the generated
downfunctions clear the api rules instead of setting them to their previous value. So when starting from state A and performing a change to an api rule that is not null/nil/admin-only and subsequently running amigrate downone ends up in state B which is missing the api rule present in state A.This PR changes the code generation such that the
downfunctions set api rules to their previous value instead of clearing them.