Skip to content

Commit

Permalink
feat: constrain table to ensure at most one config can be active per kit
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Mar 21, 2024
1 parent 95bd131 commit 3592341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX ix_kit_configurations_active_kit_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE UNIQUE INDEX ix_kit_configurations_active_kit_id ON public.kit_configurations (kit_id)
WHERE (active);

COMMENT ON INDEX ix_kit_configurations_active_kit_id IS 'At most one kit configuration may be active per kit at any one time.'

0 comments on commit 3592341

Please sign in to comment.