From b740156bb50784fc461e2fbda13cd91e3f208b38 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Thu, 4 May 2023 22:34:41 +0100 Subject: Remove dataspace_id column from Fragment table - Remove dataspace_id column from fragment table and drop associated index, foreign key constraint and uniqueness constaint. - Add uniqueness constraint using only fragment xpath and anchor_id. - Add not-null constraint to anchor_id. - Update code and test data to remove references to dataspace_id. - Repopulate the dataspace_id in Liquibase rollback (verified with manual testing of update/rollback). Issue-ID: CPS-1677 Signed-off-by: danielhanrahan Change-Id: I467cccba25ac5d884ec790064ca58150281b7e1d --- .../test/resources/liquibase/test-changelog.yaml | 36 +++------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'integration-test/src/test/resources') diff --git a/integration-test/src/test/resources/liquibase/test-changelog.yaml b/integration-test/src/test/resources/liquibase/test-changelog.yaml index f53fef70b..f9e2e2faf 100644 --- a/integration-test/src/test/resources/liquibase/test-changelog.yaml +++ b/integration-test/src/test/resources/liquibase/test-changelog.yaml @@ -116,16 +116,13 @@ databaseChangeLog: name: attributes type: JSONB - column: + constraints: + nullable: false name: anchor_id type: BIGINT - column: name: parent_id type: BIGINT - - column: - constraints: - nullable: false - name: dataspace_id - type: INTEGER - column: name: schema_node_id type: INTEGER @@ -323,16 +320,6 @@ databaseChangeLog: name: anchor_id indexName: FKI_FRAGMENT_ANCHOR_ID_FK tableName: fragment - - changeSet: - id: 1-18 - author: cps - changes: - - createIndex: - columns: - - column: - name: dataspace_id - indexName: FKI_FRAGMENT_DATASPACE_ID_FK - tableName: fragment - changeSet: id: 1-19 author: cps @@ -358,8 +345,8 @@ databaseChangeLog: author: cps changes: - addUniqueConstraint: - columnNames: dataspace_id, anchor_id, xpath - constraintName: fragment_dataspace_id_anchor_id_xpath_key + columnNames: anchor_id, xpath + constraintName: fragment_anchor_id_xpath_key tableName: fragment - changeSet: id: 1-23 @@ -430,21 +417,6 @@ databaseChangeLog: columnNames: name constraintName: UQ_NAME tableName: dataspace - - changeSet: - id: 1-29 - author: cps - changes: - - addForeignKeyConstraint: - baseColumnNames: dataspace_id - baseTableName: fragment - constraintName: fragment_dataspace_id_fkey - deferrable: false - initiallyDeferred: false - onDelete: NO ACTION - onUpdate: NO ACTION - referencedColumnNames: id - referencedTableName: dataspace - validate: true - changeSet: id: 1-30 author: cps -- cgit 1.2.3-korg