summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/resources/changelog/db/changes/18-cascade-delete-fragment-children.yaml
blob: 62a9e2f63650f9534642fc19badab0c2e78f3c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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