From c76960c8af86b98f7698e774e6d1b31795baf01d Mon Sep 17 00:00:00 2001 From: Patrick Schalk Date: Mon, 1 Jul 2024 16:48:08 +0200 Subject: [PATCH] Provide scripts to support polyflow 4.2.0 (correlation tables, ...) --- ...0_0_7__jpa_plf_data_entry_correlations.sql | 23 +++++++++++++++++++ ..._0_16__jpa_plf_data_entry_correlations.sql | 23 +++++++++++++++++++ ...0_0_7__jpa_plf_data_entry_correlations.sql | 23 +++++++++++++++++++ ..._0_17__jpa_plf_data_entry_correlations.sql | 23 +++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 scenarios/distributed-axon-server-local-polyflow/process-platform-view-only/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql create mode 100644 scenarios/distributed-axon-server/process-application/src/main/resources/db/migrations/V0_0_16__jpa_plf_data_entry_correlations.sql create mode 100644 scenarios/distributed-axon-server/process-platform-jpa/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql create mode 100644 scenarios/single-node-jpa/src/main/resources/db/migrations/h2-postgresql/V0_0_17__jpa_plf_data_entry_correlations.sql diff --git a/scenarios/distributed-axon-server-local-polyflow/process-platform-view-only/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql b/scenarios/distributed-axon-server-local-polyflow/process-platform-view-only/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql new file mode 100644 index 0000000..d70396f --- /dev/null +++ b/scenarios/distributed-axon-server-local-polyflow/process-platform-view-only/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql @@ -0,0 +1,23 @@ +create table PLF_DATA_ENTRY_CORRELATIONS +( + OWNING_ENTRY_TYPE varchar(255) not null, + OWNING_ENTRY_ID varchar(64) not null, + ENTRY_TYPE varchar(255) not null, + ENTRY_ID varchar(64) not null, + primary key (OWNING_ENTRY_TYPE, OWNING_ENTRY_ID, ENTRY_TYPE, ENTRY_ID) +); + +create view PLF_VIEW_DATA_ENTRY_PAYLOAD as +( +select * +from PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES +union +(select ec.OWNING_ENTRY_ID as ENTRY_ID, + ec.OWNING_ENTRY_TYPE as ENTRY_TYPE, + ep.path as PATH, + ep.value as VALUE + from PLF_DATA_ENTRY_CORRELATIONS ec + join PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES ep + on + ec.ENTRY_ID = ep.ENTRY_ID and ec.ENTRY_TYPE = ep.ENTRY_TYPE) +); diff --git a/scenarios/distributed-axon-server/process-application/src/main/resources/db/migrations/V0_0_16__jpa_plf_data_entry_correlations.sql b/scenarios/distributed-axon-server/process-application/src/main/resources/db/migrations/V0_0_16__jpa_plf_data_entry_correlations.sql new file mode 100644 index 0000000..d70396f --- /dev/null +++ b/scenarios/distributed-axon-server/process-application/src/main/resources/db/migrations/V0_0_16__jpa_plf_data_entry_correlations.sql @@ -0,0 +1,23 @@ +create table PLF_DATA_ENTRY_CORRELATIONS +( + OWNING_ENTRY_TYPE varchar(255) not null, + OWNING_ENTRY_ID varchar(64) not null, + ENTRY_TYPE varchar(255) not null, + ENTRY_ID varchar(64) not null, + primary key (OWNING_ENTRY_TYPE, OWNING_ENTRY_ID, ENTRY_TYPE, ENTRY_ID) +); + +create view PLF_VIEW_DATA_ENTRY_PAYLOAD as +( +select * +from PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES +union +(select ec.OWNING_ENTRY_ID as ENTRY_ID, + ec.OWNING_ENTRY_TYPE as ENTRY_TYPE, + ep.path as PATH, + ep.value as VALUE + from PLF_DATA_ENTRY_CORRELATIONS ec + join PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES ep + on + ec.ENTRY_ID = ep.ENTRY_ID and ec.ENTRY_TYPE = ep.ENTRY_TYPE) +); diff --git a/scenarios/distributed-axon-server/process-platform-jpa/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql b/scenarios/distributed-axon-server/process-platform-jpa/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql new file mode 100644 index 0000000..d70396f --- /dev/null +++ b/scenarios/distributed-axon-server/process-platform-jpa/src/main/resources/db/migrations/V0_0_7__jpa_plf_data_entry_correlations.sql @@ -0,0 +1,23 @@ +create table PLF_DATA_ENTRY_CORRELATIONS +( + OWNING_ENTRY_TYPE varchar(255) not null, + OWNING_ENTRY_ID varchar(64) not null, + ENTRY_TYPE varchar(255) not null, + ENTRY_ID varchar(64) not null, + primary key (OWNING_ENTRY_TYPE, OWNING_ENTRY_ID, ENTRY_TYPE, ENTRY_ID) +); + +create view PLF_VIEW_DATA_ENTRY_PAYLOAD as +( +select * +from PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES +union +(select ec.OWNING_ENTRY_ID as ENTRY_ID, + ec.OWNING_ENTRY_TYPE as ENTRY_TYPE, + ep.path as PATH, + ep.value as VALUE + from PLF_DATA_ENTRY_CORRELATIONS ec + join PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES ep + on + ec.ENTRY_ID = ep.ENTRY_ID and ec.ENTRY_TYPE = ep.ENTRY_TYPE) +); diff --git a/scenarios/single-node-jpa/src/main/resources/db/migrations/h2-postgresql/V0_0_17__jpa_plf_data_entry_correlations.sql b/scenarios/single-node-jpa/src/main/resources/db/migrations/h2-postgresql/V0_0_17__jpa_plf_data_entry_correlations.sql new file mode 100644 index 0000000..d70396f --- /dev/null +++ b/scenarios/single-node-jpa/src/main/resources/db/migrations/h2-postgresql/V0_0_17__jpa_plf_data_entry_correlations.sql @@ -0,0 +1,23 @@ +create table PLF_DATA_ENTRY_CORRELATIONS +( + OWNING_ENTRY_TYPE varchar(255) not null, + OWNING_ENTRY_ID varchar(64) not null, + ENTRY_TYPE varchar(255) not null, + ENTRY_ID varchar(64) not null, + primary key (OWNING_ENTRY_TYPE, OWNING_ENTRY_ID, ENTRY_TYPE, ENTRY_ID) +); + +create view PLF_VIEW_DATA_ENTRY_PAYLOAD as +( +select * +from PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES +union +(select ec.OWNING_ENTRY_ID as ENTRY_ID, + ec.OWNING_ENTRY_TYPE as ENTRY_TYPE, + ep.path as PATH, + ep.value as VALUE + from PLF_DATA_ENTRY_CORRELATIONS ec + join PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES ep + on + ec.ENTRY_ID = ep.ENTRY_ID and ec.ENTRY_TYPE = ep.ENTRY_TYPE) +);