Skip to content

Commit

Permalink
Update schema.sql to include dataset harmonization table
Browse files Browse the repository at this point in the history
  • Loading branch information
sharra44 authored and Luke-Sikina committed Oct 1, 2024
1 parent 6a09642 commit 43e6352
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,14 @@ CREATE TABLE dict.facet__concept_node (
CONSTRAINT fk_facet FOREIGN KEY (FACET_ID) REFERENCES dict.facet(FACET_ID),
CONSTRAINT fk_concept_node FOREIGN KEY (CONCEPT_NODE_ID) REFERENCES dict.concept_node(CONCEPT_NODE_ID)
);

-- Commenting out because I don't remember what these do.

--CREATE TABLE dict.harmonized_concept_node (
-- HARMONIZED_CONCEPT_NODE_ID INT GENERATED BY DEFAULT AS IDENTITY,
-- NAME VARCHAR(512) NOT NULL,
-- DISPLAY VARCHAR(512) NOT NULL,
-- CONCEPT_PATH VARCHAR(10000) NOT NULL DEFAULT 'INVALID',
-- PARENT_ID INT,
-- PRIMARY KEY (CONCEPT_NODE_ID),
-- CONSTRAINT fk_parent FOREIGN KEY (PARENT_ID) REFERENCES harmonized_CONCEPT_NODE(CONCEPT_NODE_ID)
--);
--CREATE UNIQUE INDEX harmonized_concept_node_concept_path_idx ON harmonized_concept_node(md5(CONCEPT_PATH));
--
--CREATE TABLE dict.harmonized_concept_node__concept_node (
-- HARMONIZED_CONCEPT_NODE__CONCEPT_NODE INT GENERATED BY DEFAULT AS IDENTITY,
-- HARMONIZED_CONCEPT_NODE_ID INT NOT NULL,
-- CONCEPT_NODE_ID INT NOT NULL,
-- PRIMARY KEY (HARMONIZED_CONCEPT_NODE__CONCEPT_NODE),
-- UNIQUE(HARMONIZED_CONCEPT_NODE_ID, CONCEPT_NODE_ID),
-- CONSTRAINT fk_harmonized_CONCEPT_NODE FOREIGN KEY (HARMONIZED_CONCEPT_NODE_ID) REFERENCES harmonized_CONCEPT_NODE(HARMONIZED_CONCEPT_NODE_ID),
-- CONSTRAINT fk_CONCEPT_NODE FOREIGN KEY (CONCEPT_NODE_ID) REFERENCES CONCEPT_NODE(CONCEPT_NODE_ID)
--);
CREATE TABLE IF NOT EXISTS dict.dataset_harmonization
(
dataset_harmonization_id INT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
harmonized_dataset_id INT NOT NULL,
source_dataset_id INT NOT NULL,
UNIQUE (harmonized_dataset_id, source_dataset_id),
CONSTRAINT fk_harmonized_dataset_id FOREIGN KEY (harmonized_dataset_id)
REFERENCES dict.dataset (dataset_id),
CONSTRAINT fk_source_dataset_id FOREIGN KEY (source_dataset_id)
REFERENCES dict.dataset (dataset_id)
);

0 comments on commit 43e6352

Please sign in to comment.