Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spurious delete/create of constraints with arguments in migrations #6704

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

msullivan
Copy link
Member

The bug here was that @index was not populated in the params link
for concrete constraints by the reflection writer, and so when we
reloaded the schema from the database, it came back in an arbitrary
order.
This bug has been present for a long time, as far as I can tell, but
we tended to get "lucky" with the order pg returned the params.

This is a strictly forward fix. It can be cherry-picked but it will
only fix things for constraints created once the fix is applied. I'm
working on a backward fix as well.

Fixes #6699.

The bug here was that `@index` was not populated in the `params` link
for concrete constraints by the reflection writer, and so when we
reloaded the schema from the database, it came back in an arbitrary
order.
This bug has been present for a *long* time, as far as I can tell, but
we tended to get "lucky" with the order pg returned the params.

This is a strictly *forward* fix. It can be cherry-picked but it will
only fix things for constraints created once the fix is applied. I'm
working on a backward fix as well.

Fixes #6699.
@msullivan msullivan merged commit ba2b94a into master Jan 18, 2024
22 checks passed
@msullivan msullivan deleted the constraint-issue-fwd branch January 18, 2024 01:07
msullivan added a commit that referenced this pull request Jan 19, 2024
#6704)

The bug here was that `@index` was not populated in the `params` link
for concrete constraints by the reflection writer, and so when we
reloaded the schema from the database, it came back in an arbitrary
order.
This bug has been present for a *long* time, as far as I can tell, but
we tended to get "lucky" with the order pg returned the params.

This is a strictly *forward* fix. It can be cherry-picked but it will
only fix things for constraints created once the fix is applied. I'm
working on a backward fix as well.

Fixes #6699.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration wants to drop & recreate constraints. No schema changes.
2 participants