-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change firmware uniqueness constraint (#221)
* Change firmware uniqueness constraint * Update test
- Loading branch information
1 parent
d3ec552
commit 812608f
Showing
2 changed files
with
20 additions
and
3 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,17 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
|
||
-- Not possible to drop unique constraint with ALTER TABLE | ||
-- See https://github.com/cockroachdb/cockroach/issues/42840 | ||
DROP INDEX vendor_component_version_unique CASCADE; | ||
ALTER TABLE component_firmware_version ADD CONSTRAINT vendor_component_version_filename_unique UNIQUE (vendor, component, version, filename); | ||
|
||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
|
||
DROP INDEX vendor_component_version_filename_unique CASCADE; | ||
ALTER TABLE component_firmware_version ADD CONSTRAINT vendor_component_version_unique UNIQUE (vendor, component, version); | ||
|
||
-- +goose StatementEnd |
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