diff --git a/db/schema.sql b/db/schema.sql index 764fea8..379ce9c 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -1,7 +1,7 @@ CREATE schema dict; CREATE TABLE dict.dataset ( - DATASET_ID INT GENERATED ALWAYS AS IDENTITY, + DATASET_ID INT GENERATED BY DEFAULT AS IDENTITY, REF VARCHAR(512) NOT NULL, FULL_NAME VARCHAR(512) NOT NULL, ABBREVIATION VARCHAR(512) NOT NULL, @@ -11,7 +11,7 @@ CREATE TABLE dict.dataset ( ); CREATE TABLE dict.dataset_meta ( - DATASET_META_ID INT GENERATED ALWAYS AS IDENTITY, + DATASET_META_ID INT GENERATED BY DEFAULT AS IDENTITY, DATASET_ID INT NOT NULL, KEY VARCHAR(256) NOT NULL, VALUE TEXT NOT NULL, @@ -20,7 +20,7 @@ CREATE TABLE dict.dataset_meta ( ); CREATE TABLE dict.consent ( - CONSENT_ID INT GENERATED ALWAYS AS IDENTITY, + CONSENT_ID INT GENERATED BY DEFAULT AS IDENTITY, DATASET_ID INT NOT NULL, CONSENT_CODE VARCHAR(512) NOT NULL, DESCRIPTION VARCHAR(512) NOT NULL, @@ -33,7 +33,7 @@ CREATE TABLE dict.consent ( ); CREATE TABLE dict.concept_node ( - CONCEPT_NODE_ID INT GENERATED ALWAYS AS IDENTITY, + CONCEPT_NODE_ID INT GENERATED BY DEFAULT AS IDENTITY, DATASET_ID INT NOT NULL, NAME VARCHAR(512) NOT NULL, DISPLAY VARCHAR(512) NOT NULL, @@ -48,7 +48,7 @@ CREATE TABLE dict.concept_node ( CREATE UNIQUE INDEX concept_node_concept_path_idx ON dict.CONCEPT_NODE (md5(CONCEPT_PATH)); CREATE TABLE dict.concept_node_meta ( - CONCEPT_NODE_META_ID INT GENERATED ALWAYS AS IDENTITY, + CONCEPT_NODE_META_ID INT GENERATED BY DEFAULT AS IDENTITY, CONCEPT_NODE_ID INT NOT NULL, KEY VARCHAR(256) NOT NULL, VALUE TEXT NOT NULL, @@ -57,7 +57,7 @@ CREATE TABLE dict.concept_node_meta ( CONSTRAINT fk_CONCEPT_NODE FOREIGN KEY (CONCEPT_NODE_ID) REFERENCES dict.CONCEPT_NODE(CONCEPT_NODE_ID) ); CREATE TABLE dict.facet_category ( - FACET_CATEGORY_ID INT GENERATED ALWAYS AS IDENTITY, + FACET_CATEGORY_ID INT GENERATED BY DEFAULT AS IDENTITY, NAME VARCHAR(512) NOT NULL, DISPLAY VARCHAR(512) NOT NULL, DESCRIPTION TEXT DEFAULT '', @@ -66,7 +66,7 @@ CREATE TABLE dict.facet_category ( ); CREATE TABLE dict.facet ( - FACET_ID INT GENERATED ALWAYS AS IDENTITY, + FACET_ID INT GENERATED BY DEFAULT AS IDENTITY, FACET_CATEGORY_ID INT NOT NULL, NAME VARCHAR(512) NOT NULL, DISPLAY VARCHAR(512) NOT NULL, @@ -79,7 +79,7 @@ CREATE TABLE dict.facet ( ); CREATE TABLE dict.facet_meta ( - FACET_META_ID INT GENERATED ALWAYS AS IDENTITY, + FACET_META_ID INT GENERATED BY DEFAULT AS IDENTITY, FACET_ID INT NOT NULL, KEY VARCHAR(256) NOT NULL, VALUE TEXT NOT NULL, @@ -88,7 +88,7 @@ CREATE TABLE dict.facet_meta ( ); CREATE TABLE dict.facet_category_meta ( - FACET_CATEGORY_META_ID INT GENERATED ALWAYS AS IDENTITY, + FACET_CATEGORY_META_ID INT GENERATED BY DEFAULT AS IDENTITY, FACET_CATEGORY_ID INT NOT NULL, KEY VARCHAR(256) NOT NULL, VALUE TEXT NOT NULL, @@ -97,7 +97,7 @@ CREATE TABLE dict.facet_category_meta ( ); CREATE TABLE dict.facet__concept_node ( - FACET__CONCEPT_NODE_ID INT GENERATED ALWAYS AS IDENTITY, + FACET__CONCEPT_NODE_ID INT GENERATED BY DEFAULT AS IDENTITY, FACET_ID INT NOT NULL, CONCEPT_NODE_ID INT NOT NULL, PRIMARY KEY (FACET__CONCEPT_NODE_ID), @@ -109,7 +109,7 @@ CREATE TABLE dict.facet__concept_node ( -- Commenting out because I don't remember what these do. --CREATE TABLE dict.harmonized_concept_node ( --- HARMONIZED_CONCEPT_NODE_ID INT GENERATED ALWAYS AS IDENTITY, +-- 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', @@ -120,7 +120,7 @@ CREATE TABLE dict.facet__concept_node ( --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 ALWAYS AS IDENTITY, +-- 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),