diff options
Diffstat (limited to 'cps-ri/src/main/resources/changelog')
4 files changed, 21 insertions, 1 deletions
diff --git a/cps-ri/src/main/resources/changelog/changelog-master.yaml b/cps-ri/src/main/resources/changelog/changelog-master.yaml index 218e78b85c..cb5392ba57 100644 --- a/cps-ri/src/main/resources/changelog/changelog-master.yaml +++ b/cps-ri/src/main/resources/changelog/changelog-master.yaml @@ -45,4 +45,6 @@ databaseChangeLog: - include: file: changelog/db/changes/14-loadData-dmi-registry-2022-05-10-schema-set.yaml - include: - file: changelog/db/changes/15-rename-column-yang-resource-table.yaml
\ No newline at end of file + file: changelog/db/changes/15-rename-column-yang-resource-table.yaml + - include: + file: changelog/db/changes/16-insert-cm-handle-state.yaml
\ No newline at end of file diff --git a/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql new file mode 100644 index 0000000000..64b185f3b2 --- /dev/null +++ b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql @@ -0,0 +1,3 @@ +create view cmHandles as select * from fragment where xpath ~* '^/dmi-registry/cm-handles\[@id=''[\w\-]+''\]$'; +insert into fragment(xpath, attributes, anchor_id, parent_id, dataspace_id, schema_node_id) select concat(xpath, '/state'), to_jsonb(concat('{"cm-handle-state": "ADVISED", "last-update-time": "', to_char(now(), 'YYYY-MM-DD"T"HH24:MI:SS.MSTZHTZM'), '"}')::json), anchor_id, id, dataspace_id, schema_node_id from cmHandles; +drop view cmHandles;
\ No newline at end of file diff --git a/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-rollback.sql b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-rollback.sql new file mode 100644 index 0000000000..aaf05a24cb --- /dev/null +++ b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-rollback.sql @@ -0,0 +1,4 @@ +delete from fragment where xpath ~* '^/dmi-registry/cm-handles\[@id=''[\w\-]+''\]/state/lock-reason$'; +delete from fragment where xpath ~* '^/dmi-registry/cm-handles\[@id=''[\w\-]+''\]/state/datastores/operational$'; +delete from fragment where xpath ~* '^/dmi-registry/cm-handles\[@id=''[\w\-]+''\]/state/datastores$'; +delete from fragment where xpath ~* '^/dmi-registry/cm-handles\[@id=''[\w\-]+''\]/state$';
\ No newline at end of file diff --git a/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state.yaml b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state.yaml new file mode 100644 index 0000000000..0f8c429f4a --- /dev/null +++ b/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state.yaml @@ -0,0 +1,11 @@ +databaseChangeLog: + - changeSet: + author: cps + label: insert-cm-handle-state + id: 16 + changes: + - sqlFile: + path: changelog/db/changes/16-insert-cm-handle-state-forward.sql + rollback: + - sqlFile: + path: changelog/db/changes/16-insert-cm-handle-state-rollback.sql
\ No newline at end of file |