Skip to content

Commit

Permalink
LANTERN-595: Adding constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
archita-ekkirala committed Aug 14, 2024
1 parent b4a06a9 commit 86d5b9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ $$ LANGUAGE plpgsql;

SELECT delete_duplicate_data_in_healthit_products_map();

ALTER TABLE IF EXISTS public.healthit_products_map ADD CONSTRAINT unique_id_healthit_product UNIQUE (id, healthit_product_id);

COMMIT;
3 changes: 2 additions & 1 deletion db/sql/dbsetup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ CREATE TABLE healthit_products (

CREATE TABLE healthit_products_map (
id SERIAL,
healthit_product_id INT REFERENCES healthit_products(id) ON DELETE SET NULL
healthit_product_id INT REFERENCES healthit_products(id) ON DELETE SET NULL,
CONSTRAINT unique_id_healthit_product UNIQUE(id, healthit_product_id)
);

CREATE TABLE certification_criteria (
Expand Down

0 comments on commit 86d5b9e

Please sign in to comment.