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
diff --git a/integration-test/src/test/resources/liquibase/test-changelog.yaml b/integration-test/src/test/resources/liquibase/test-changelog.yaml
index f53fef7..f9e2e2f 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 @@
                   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 @@
             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 @@
       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 @@
             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: