From 6ab721980b03609aee4354b8533af53f96948e4a Mon Sep 17 00:00:00 2001 From: Ryan Doherty Date: Thu, 3 Oct 2024 13:58:25 -0400 Subject: [PATCH] Add unique constraint on strategies.signature column; WDK does not allow dups but nice to enforce in the schema --- Model/data/create_schema_userlogins5.sql | 1 + Model/data/create_schema_userlogins5_postgres.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/Model/data/create_schema_userlogins5.sql b/Model/data/create_schema_userlogins5.sql index a18453c0a6..a0a1f4247e 100644 --- a/Model/data/create_schema_userlogins5.sql +++ b/Model/data/create_schema_userlogins5.sql @@ -269,6 +269,7 @@ CREATE TABLE userlogins5.strategies ( prev_strategy_id NUMBER(12), migration_id NUMBER(12), CONSTRAINT "strategies_pk" PRIMARY KEY (strategy_id), + CONSTRAINT "strategies_uq01" UNIQUE (signature), CONSTRAINT "strategies_fk01" FOREIGN KEY (root_step_id) REFERENCES userlogins5.steps (step_id), CONSTRAINT "strategies_fk02" FOREIGN KEY (user_id) diff --git a/Model/data/create_schema_userlogins5_postgres.sql b/Model/data/create_schema_userlogins5_postgres.sql index b54fa49101..08baccf5b1 100644 --- a/Model/data/create_schema_userlogins5_postgres.sql +++ b/Model/data/create_schema_userlogins5_postgres.sql @@ -259,6 +259,7 @@ CREATE TABLE userlogins5.strategies ( prev_strategy_id NUMERIC(12), migration_id NUMERIC(12), CONSTRAINT "strategies_pk" PRIMARY KEY (strategy_id), + CONSTRAINT "strategies_uq01" UNIQUE (signature), CONSTRAINT "strategies_fk01" FOREIGN KEY (root_step_id) REFERENCES userlogins5.steps (step_id), CONSTRAINT "strategies_fk02" FOREIGN KEY (user_id)