mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
adjust sql migration
This commit is contained in:
+4
@@ -1,5 +1,9 @@
|
|||||||
|
BEGIN;
|
||||||
|
|
||||||
DROP INDEX IF EXISTS idx_daily_checklists_unique_non_rejected;
|
DROP INDEX IF EXISTS idx_daily_checklists_unique_non_rejected;
|
||||||
|
|
||||||
ALTER TABLE daily_checklists
|
ALTER TABLE daily_checklists
|
||||||
ADD CONSTRAINT daily_checklists_date_kandang_category_key
|
ADD CONSTRAINT daily_checklists_date_kandang_category_key
|
||||||
UNIQUE (date, kandang_id, category);
|
UNIQUE (date, kandang_id, category);
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|||||||
+4
@@ -1,6 +1,10 @@
|
|||||||
|
BEGIN;
|
||||||
|
|
||||||
ALTER TABLE daily_checklists
|
ALTER TABLE daily_checklists
|
||||||
DROP CONSTRAINT IF EXISTS daily_checklists_date_kandang_category_key;
|
DROP CONSTRAINT IF EXISTS daily_checklists_date_kandang_category_key;
|
||||||
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_daily_checklists_unique_non_rejected
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_daily_checklists_unique_non_rejected
|
||||||
ON daily_checklists (date, kandang_id, category)
|
ON daily_checklists (date, kandang_id, category)
|
||||||
WHERE (status IS NULL OR status <> 'REJECTED');
|
WHERE (status IS NULL OR status <> 'REJECTED');
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|||||||
Reference in New Issue
Block a user