-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[4.x] Fix spurious delete/create of constraints with arguments in mig…
…rations (#6712) 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. Fixes #6699. Unfortunately fixing newly created constraints doesn't help us on 4.x where @index may already be missing. Fix this during introspection by falling back to the nearest abstract ancestor, which will have a correct @index. I've only been able to reproduce this issue with fairly large schemas, so there's no test attached, but I tested with: https://github.com/SeedCompany/cord-api-v3/tree/9028ad7f05d51e4b3b07f5154cb0ed62ad43dc7d/dbschema which is from the originally reported issue.
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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