diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2023-05-04 22:34:41 +0100 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2023-05-12 13:17:38 +0100 |
commit | b740156bb50784fc461e2fbda13cd91e3f208b38 (patch) | |
tree | b305c9c827ae7c323e40ac10975a34093e86fecc /integration-test | |
parent | 26a51754dd8aa9b467bcb442e6042f22af2ba001 (diff) |
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 <daniel.hanrahan@est.tech>
Change-Id: I467cccba25ac5d884ec790064ca58150281b7e1d
Diffstat (limited to 'integration-test')
-rw-r--r-- | integration-test/src/test/resources/liquibase/test-changelog.yaml | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/integration-test/src/test/resources/liquibase/test-changelog.yaml b/integration-test/src/test/resources/liquibase/test-changelog.yaml index f53fef70b7..f9e2e2fafb 100644 --- a/integration-test/src/test/resources/liquibase/test-changelog.yaml +++ b/integration-test/src/test/resources/liquibase/test-changelog.yaml @@ -116,17 +116,14 @@ 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 tableName: fragment @@ -324,16 +321,6 @@ databaseChangeLog: 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 changes: @@ -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 @@ -431,21 +418,6 @@ databaseChangeLog: 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 changes: |