summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ri/src/main/resources')
-rw-r--r--cps-ri/src/main/resources/changelog/changelog-master.yaml2
-rw-r--r--cps-ri/src/main/resources/changelog/db/changes/18-cascade-delete-fragment-children.yaml34
2 files changed, 36 insertions, 0 deletions
diff --git a/cps-ri/src/main/resources/changelog/changelog-master.yaml b/cps-ri/src/main/resources/changelog/changelog-master.yaml
index 43a54caf64..bf172d8eae 100644
--- a/cps-ri/src/main/resources/changelog/changelog-master.yaml
+++ b/cps-ri/src/main/resources/changelog/changelog-master.yaml
@@ -50,3 +50,5 @@ databaseChangeLog:
file: changelog/db/changes/16-insert-cm-handle-state.yaml
- include:
file: changelog/db/changes/17-add-index-to-schema-set-yang-resources.yaml
+ - include:
+ file: changelog/db/changes/18-cascade-delete-fragment-children.yaml
diff --git a/cps-ri/src/main/resources/changelog/db/changes/18-cascade-delete-fragment-children.yaml b/cps-ri/src/main/resources/changelog/db/changes/18-cascade-delete-fragment-children.yaml
new file mode 100644
index 0000000000..62a9e2f636
--- /dev/null
+++ b/cps-ri/src/main/resources/changelog/db/changes/18-cascade-delete-fragment-children.yaml
@@ -0,0 +1,34 @@
+databaseChangeLog:
+ - changeSet:
+ author: cps
+ id: 18
+ changes:
+ - dropForeignKeyConstraint:
+ baseTableName: fragment
+ constraintName: fragment_parent_id_fkey
+ - addForeignKeyConstraint:
+ baseColumnNames: parent_id
+ baseTableName: fragment
+ constraintName: fragment_parent_id_fkey
+ deferrable: false
+ initiallyDeferred: false
+ onDelete: CASCADE
+ onUpdate: NO ACTION
+ referencedColumnNames: id
+ referencedTableName: fragment
+ validate: true
+ rollback:
+ - dropForeignKeyConstraint:
+ baseTableName: fragment
+ constraintName: fragment_parent_id_fkey
+ - addForeignKeyConstraint:
+ baseColumnNames: parent_id
+ baseTableName: fragment
+ constraintName: fragment_parent_id_fkey
+ deferrable: false
+ initiallyDeferred: false
+ onDelete: NO ACTION
+ onUpdate: NO ACTION
+ referencedColumnNames: id
+ referencedTableName: fragment
+ validate: true