basic unique name implementation (#123)

This commit is contained in:
Michael Quigley
2023-12-08 12:03:07 -05:00
parent ead350b442
commit f61b2c9086
9 changed files with 58 additions and 7 deletions

View File

@ -0,0 +1,7 @@
-- +migrate Up
-- remove the old unique index (which did not respect the deleted flag)
ALTER TABLE shares DROP CONSTRAINT shares_token_key;
-- add a new unique index which only constrains uniqueness for not-deleted rows
CREATE UNIQUE INDEX shares_token_idx ON shares(token) WHERE deleted is false;