diff --git a/service/src/main/resources/db/changelog.xml b/service/src/main/resources/db/changelog.xml index 28b4ce572..4e6f19740 100644 --- a/service/src/main/resources/db/changelog.xml +++ b/service/src/main/resources/db/changelog.xml @@ -1,18 +1,5 @@ - - - - - - - - - - - - - diff --git a/service/src/main/resources/db/changesets/20230410_schema_reset.yaml b/service/src/main/resources/db/changesets/20230410_schema_reset.yaml index 854fb245f..3979a19de 100644 --- a/service/src/main/resources/db/changesets/20230410_schema_reset.yaml +++ b/service/src/main/resources/db/changesets/20230410_schema_reset.yaml @@ -1,31 +1,32 @@ databaseChangeLog: - changeSet: id: schema_reset - author: marikomedlock, chenchalsubraveti + author: marikomedlock + dbms: postgresql changes: - createTable: tableName: study columns: - column: name: id - type: ${id.type} + type: text constraints: primaryKey: true nullable: false unique: true - column: name: display_name - type: ${text.type} + type: text constraints: nullable: true - column: name: description - type: ${text.type} + type: text constraints: nullable: true - column: name: properties - type: ${jsonb.type} + type: jsonb constraints: nullable: true - column: @@ -36,7 +37,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: created_by - type: ${text.type} + type: text constraints: nullable: false - column: @@ -47,7 +48,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: last_modified_by - type: ${text.type} + type: text constraints: nullable: false @@ -56,14 +57,14 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: primaryKey: true nullable: false unique: true - column: name: study_id - type: ${id.type} + type: text constraints: references: study(id) foreignKeyName: fk_cs_s @@ -72,22 +73,22 @@ databaseChangeLog: remarks: Deleting a study will cascade to delete the concept sets contained in it - column: name: underlay - type: ${text.type} + type: text constraints: nullable: false - column: name: entity - type: ${text.type} + type: text constraints: nullable: false - column: name: display_name - type: ${text.type} + type: text constraints: nullable: true - column: name: description - type: ${text.type} + type: text constraints: nullable: true - column: @@ -98,7 +99,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: created_by - type: ${text.type} + type: text constraints: nullable: false - column: @@ -109,7 +110,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: last_modified_by - type: ${text.type} + type: text constraints: nullable: false @@ -118,14 +119,14 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: primaryKey: true nullable: false unique: true - column: name: study_id - type: ${id.type} + type: text constraints: references: study(id) foreignKeyName: fk_c_s @@ -134,17 +135,17 @@ databaseChangeLog: remarks: Deleting a study will cascade to delete the cohorts contained in it - column: name: underlay - type: ${text.type} + type: text constraints: nullable: false - column: name: display_name - type: ${text.type} + type: text constraints: nullable: true - column: name: description - type: ${text.type} + type: text constraints: nullable: true - column: @@ -155,7 +156,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: created_by - type: ${text.type} + type: text constraints: nullable: false - column: @@ -166,7 +167,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: last_modified_by - type: ${text.type} + type: text constraints: nullable: false @@ -175,14 +176,14 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: primaryKey: true nullable: false unique: true - column: name: cohort_id - type: ${id.type} + type: text constraints: references: cohort(id) foreignKeyName: fk_r_c @@ -191,12 +192,12 @@ databaseChangeLog: remarks: Deleting a cohort will cascade to delete the reviews associated with it - column: name: display_name - type: ${text.type} + type: text constraints: nullable: true - column: name: description - type: ${text.type} + type: text constraints: nullable: true - column: @@ -212,7 +213,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: created_by - type: ${text.type} + type: text constraints: nullable: false - column: @@ -223,7 +224,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: last_modified_by - type: ${text.type} + type: text constraints: nullable: false - addUniqueConstraint: @@ -236,7 +237,7 @@ databaseChangeLog: columns: - column: name: review_id - type: ${id.type} + type: text constraints: references: review(id) foreignKeyName: fk_pei_r @@ -245,7 +246,7 @@ databaseChangeLog: remarks: Deleting a review will cascade to delete the entity instances contained in it - column: name: id - type: ${id.type} + type: text constraints: nullable: false unique: false @@ -260,14 +261,14 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: primaryKey: true nullable: false unique: true - column: name: cohort_id - type: ${id.type} + type: text constraints: references: cohort(id) foreignKeyName: fk_cr_c @@ -276,7 +277,7 @@ databaseChangeLog: remarks: Deleting a cohort will cascade to delete the cohort revisions associated with it - column: name: review_id - type: ${id.type} + type: text constraints: references: review(id) foreignKeyName: fk_cr_r @@ -306,7 +307,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: created_by - type: ${text.type} + type: text constraints: nullable: false - column: @@ -317,7 +318,7 @@ databaseChangeLog: defaultValueComputed: now() - column: name: last_modified_by - type: ${text.type} + type: text constraints: nullable: false @@ -326,12 +327,12 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: nullable: false - column: name: cohort_revision_id - type: ${id.type} + type: text constraints: references: cohort_revision(id) foreignKeyName: fk_cgs_cr @@ -340,10 +341,10 @@ databaseChangeLog: remarks: Deleting a cohort revision will cascade to delete the criteria group sections contained in it - column: name: display_name - type: ${text.type} + type: text - column: name: operator - type: ${text.type} + type: text - column: name: is_excluded type: boolean @@ -364,17 +365,17 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: nullable: false - column: name: criteria_group_section_id - type: ${id.type} + type: text constraints: nullable: false - column: name: cohort_revision_id - type: ${id.type} + type: text constraints: references: cohort_revision(id) foreignKeyName: fk_cg_cr @@ -383,13 +384,13 @@ databaseChangeLog: remarks: Deleting a cohort revision will cascade to delete the criteria groups contained in it - column: name: display_name - type: ${text.type} + type: text - column: name: entity - type: ${text.type} + type: text - column: name: group_by_count_operator - type: ${text.type} + type: text - column: name: group_by_count_value type: integer @@ -408,22 +409,22 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: nullable: false - column: name: criteria_group_id - type: ${id.type} + type: text constraints: nullable: true - column: name: criteria_group_section_id - type: ${id.type} + type: text constraints: nullable: true - column: name: cohort_revision_id - type: ${id.type} + type: text constraints: references: cohort_revision(id) foreignKeyName: ck_crit_cr @@ -432,7 +433,7 @@ databaseChangeLog: remarks: Deleting a cohort revision will cascade to delete the criteria contained in it - column: name: concept_set_id - type: ${id.type} + type: text constraints: references: concept_set(id) foreignKeyName: fk_crit_cs @@ -441,25 +442,25 @@ databaseChangeLog: remarks: Deleting a concept set will cascade to delete the criteria contained in it - column: name: display_name - type: ${text.type} + type: text - column: name: plugin_name - type: ${text.type} + type: text constraints: nullable: false - column: name: selection_data - type: ${long.text.type} + type: text constraints: nullable: false - column: name: ui_config - type: ${long.text.type} + type: text constraints: nullable: false - column: name: tags - type: ${text.array.type} + type: text[] constraints: nullable: false - column: @@ -477,12 +478,12 @@ databaseChangeLog: columns: - column: name: id - type: ${id.type} + type: text constraints: nullable: false - column: name: cohort_id - type: ${id.type} + type: text constraints: references: cohort(id) foreignKeyName: fk_ak_c @@ -491,22 +492,22 @@ databaseChangeLog: remarks: Deleting a cohort will cascade to delete the annotation keys associated with it - column: name: display_name - type: ${text.type} + type: text constraints: nullable: false - column: name: description - type: ${text.type} + type: text constraints: nullable: true - column: name: data_type - type: ${text.type} + type: text constraints: nullable: false - column: name: enum_vals - type: ${text.array.type} + type: text[] constraints: nullable: false - addUniqueConstraint: @@ -519,22 +520,22 @@ databaseChangeLog: columns: - column: name: cohort_id - type: ${id.type} + type: text constraints: nullable: false - column: name: annotation_key_id - type: ${id.type} + type: text constraints: nullable: false - column: name: review_id - type: ${id.type} + type: text constraints: nullable: false - column: name: primary_entity_instance_id - type: ${id.type} + type: text constraints: nullable: false - column: @@ -549,7 +550,7 @@ databaseChangeLog: nullable: true - column: name: string_val - type: ${text.type} + type: text constraints: nullable: true - column: diff --git a/service/src/main/resources/db/changesets/20230530_avoid_postgres_specific_features.yaml b/service/src/main/resources/db/changesets/20230530_avoid_postgres_specific_features.yaml index 81149467d..17878cc42 100644 --- a/service/src/main/resources/db/changesets/20230530_avoid_postgres_specific_features.yaml +++ b/service/src/main/resources/db/changesets/20230530_avoid_postgres_specific_features.yaml @@ -1,7 +1,8 @@ databaseChangeLog: - changeSet: id: avoid_postgres_specific_features - author: marikomedlock, chenchalsubraveti + author: marikomedlock + dbms: postgresql # TODO: Remove the jsonb and 2 text[] columns in a follow-on changeset, once we're sure this migration was successful. # study.properties, criteria.tags, annotation_key.enumVals changes: @@ -10,7 +11,7 @@ databaseChangeLog: columns: - column: name: study_id - type: ${id.type} + type: text constraints: references: study(id) foreignKeyName: fk_sp_s @@ -19,12 +20,12 @@ databaseChangeLog: remarks: Deleting a study will cascade to delete its properties - column: name: key - type: ${id.type} + type: text constraints: nullable: false - column: name: value - type: ${text.type} + type: text constraints: nullable: true - addUniqueConstraint: @@ -43,22 +44,22 @@ databaseChangeLog: columns: - column: name: criteria_id - type: ${id.type} + type: text constraints: nullable: false - column: name: criteria_group_id - type: ${id.type} + type: text constraints: nullable: true - column: name: criteria_group_section_id - type: ${id.type} + type: text constraints: nullable: true - column: name: cohort_revision_id - type: ${id.type} + type: text constraints: references: cohort_revision(id) foreignKeyName: ck_crit_cr @@ -67,7 +68,7 @@ databaseChangeLog: remarks: Deleting a cohort revision will cascade to delete the criteria contained in it - column: name: concept_set_id - type: ${id.type} + type: text constraints: references: concept_set(id) foreignKeyName: fk_crit_cs @@ -76,12 +77,12 @@ databaseChangeLog: remarks: Deleting a concept set will cascade to delete the criteria contained in it - column: name: key - type: ${id.type} + type: text constraints: nullable: false - column: name: value - type: ${text.type} + type: text constraints: nullable: false - addUniqueConstraint: @@ -104,17 +105,17 @@ databaseChangeLog: columns: - column: name: enum - type: ${id.type} + type: text constraints: nullable: false - column: name: annotation_key_id - type: ${id.type} + type: text constraints: nullable: false - column: name: cohort_id - type: ${id.type} + type: text constraints: nullable: false - addUniqueConstraint: