Skip to content

Commit

Permalink
OAM-260: Removed and recreated unique indices for stock cards
Browse files Browse the repository at this point in the history
  • Loading branch information
sradziszewski committed Jul 31, 2024
1 parent 6da0179 commit 9d71b22
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DROP INDEX IF EXISTS uniq_stock_card_facility_program_product_lot;
DROP INDEX IF EXISTS uniq_stock_card_facility_program_product;

CREATE UNIQUE INDEX uniq_stock_card_facility_program_product_lot
ON stock_cards(facilityId, programId, orderableId, lotId)
WHERE lotId IS NOT NULL;

CREATE UNIQUE INDEX uniq_stock_card_facility_program_product
ON stock_cards(facilityId, programId, orderableId)
WHERE lotId IS NULL;

0 comments on commit 9d71b22

Please sign in to comment.