Remove dataspace_id column from Fragment table 91/134491/7
authordanielhanrahan <daniel.hanrahan@est.tech>
Thu, 4 May 2023 21:34:41 +0000 (22:34 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 12 May 2023 12:17:38 +0000 (13:17 +0100)
commitb740156bb50784fc461e2fbda13cd91e3f208b38
treeb305c9c827ae7c323e40ac10975a34093e86fecc
parent26a51754dd8aa9b467bcb442e6042f22af2ba001
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
13 files changed:
cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntityArranger.java
cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java
cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java
cps-ri/src/main/resources/changelog/changelog-master.yaml
cps-ri/src/main/resources/changelog/db/changes/19-delete-not-required-dataspace-id-from-fragment.yaml [new file with mode: 0644]
cps-ri/src/main/resources/changelog/db/changes/19-repopulate-dataspace-id-for-rollback.sql [new file with mode: 0644]
cps-ri/src/test/resources/data/anchor.sql
cps-ri/src/test/resources/data/fragment.sql
cps-ri/src/test/resources/data/perf-test.sql [new file with mode: 0644]
cps-ri/src/test/resources/data/schemaset.sql
integration-test/src/test/resources/liquibase/test-changelog.yaml