-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a testcase for dropping unique constraints (#117)
Now that adding `UNIQUE` constraints is restricted to single columns, it is possible to drop them using the same single-column duplication + triggers method that is used to drop check constraints and foreign keys. Add an example migration and a testcase to check that this works as expected; the new version of the schema contains a column that does not have a `UNIQUE` constraint while the old version does.
- Loading branch information
1 parent
df004b6
commit eca293a
Showing
2 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "27_drop_unique_constraint", | ||
"operations": [ | ||
{ | ||
"drop_constraint": { | ||
"table": "reviews", | ||
"column": "review", | ||
"name": "reviews_review_unique", | ||
"up": "review", | ||
"down": "review || '-' || (random()*1000000)::integer" | ||
} | ||
} | ||
] | ||
} |
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