DEV-000064 allow legacy prospective metadata
This commit is contained in:
@@ -6,15 +6,5 @@ ALTER TABLE continuity.prospective_items ADD COLUMN IF NOT EXISTS source_intent_
|
||||
ALTER TABLE continuity.prospective_items ADD COLUMN IF NOT EXISTS source_utterance_id TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE continuity.prospective_items ADD COLUMN IF NOT EXISTS summary TEXT NOT NULL DEFAULT '';
|
||||
|
||||
DO $$ BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname='prospective_items_reminder_metadata_v1' AND conrelid='continuity.prospective_items'::regclass) THEN
|
||||
ALTER TABLE continuity.prospective_items ADD CONSTRAINT prospective_items_reminder_metadata_v1 CHECK (
|
||||
state <> 'ARMED' OR summary <> ''
|
||||
) NOT VALID;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
ALTER TABLE continuity.prospective_items VALIDATE CONSTRAINT prospective_items_reminder_metadata_v1;
|
||||
|
||||
RESET ROLE;
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user