Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow dropping broken constraint indexes in more cases
Constraint indexes can normally not be dropped directly. Instead the owning constraint should be dropped instead. However, when an index-backed constraint is created, the index and the constraint are created separately, and we have historically had bugs that allowed a constraint _index_ to be created, such that it was not linked to its owning constraint record, or such that its owning constraint record was never created. These orhpaned indexes are still accepted as functioning indexes by our IndexingService, but they are not really usable without their constraint. Previously, these indexes would get stuck in this state. Without their owning constraint, they cannot be dropped. One case was fixed a while back, which allowed constraint indexes to be dropped in one particular case. However, a number of other cases were missed. This PR fixes the remaining cases, such that constraint indexes that are not linked to any owning constraint can now be dropped in all cases. We still maintian the behaviour that a constraint index cannot be directly dropped, but this is now only checked if the index is actually linked to a valid constraint.
- Loading branch information
Showing
6 changed files
with
136 additions
and
11 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
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