aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql')
-rw-r--r--cps-ri/src/main/resources/changelog/db/changes/16-insert-cm-handle-state-forward.sql3
1 files changed, 3 insertions, 0 deletions
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 000000000..64b185f3b
--- /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