Fix Postgres queries in clamp database migration 30/137830/1 master
authorFrancescoFioraEst <francesco.fiora@est.tech>
Thu, 2 May 2024 09:16:41 +0000 (10:16 +0100)
committerFrancesco Fiora <francesco.fiora@est.tech>
Thu, 2 May 2024 10:04:43 +0000 (10:04 +0000)
Issue-ID: POLICY-4986
Change-Id: If70ccf429547db035a49c4151b88a211d6504e38
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
23 files changed:
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0100-automationcomposition.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0200-automationcompositiondefinition.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0300-automationcompositionelement.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0400-nodetemplatestate.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0500-participant.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0600-participantsupportedelements.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0700-ac_compositionId_index.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1100-automationcompositionelement_fk.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1200-nodetemplate_fk.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1300-participantsupportedelements_fk.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0100-automationcomposition.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0200-automationcompositiondefinition.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0300-automationcompositionelement.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0400-nodetemplatestate.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0500-participant.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0600-participantsupportedelements.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0700-ac_compositionId_index.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0800-ac_element_fk_index.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0900-dt_element_fk_index.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1000-supported_element_fk_index.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1100-automationcompositionelement_fk.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1200-nodetemplate_fk.sql
policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1300-participantsupportedelements_fk.sql

index f17216f..222e2aa 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.automationcomposition;
\ No newline at end of file
+DROP TABLE automationcomposition;
\ No newline at end of file
index 9ef6e9c..167ce93 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.automationcompositiondefinition;
\ No newline at end of file
+DROP TABLE automationcompositiondefinition;
\ No newline at end of file
index 2255d08..044f107 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.automationcompositionelement;
\ No newline at end of file
+DROP TABLE automationcompositionelement;
\ No newline at end of file
index 7aee61b..0a64681 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.nodetemplatestate;
\ No newline at end of file
+DROP TABLE nodetemplatestate;
\ No newline at end of file
index 3f20fef..8f7f1e8 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.participant;
\ No newline at end of file
+DROP TABLE participant;
\ No newline at end of file
index e5ce88a..8b3d4de 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP TABLE clampacm.participantsupportedacelements;
\ No newline at end of file
+DROP TABLE participantsupportedacelements;
\ No newline at end of file
index c21fd9e..c4b6532 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-DROP INDEX IF EXISTS ac_element_fk;
\ No newline at end of file
+DROP INDEX IF EXISTS ac_compositionid;
\ No newline at end of file
index c5b7eb3..9b19dc0 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.automationcompositionelement DROP CONSTRAINT IF EXISTS ac_element_fk;
\ No newline at end of file
+ALTER TABLE automationcompositionelement DROP CONSTRAINT IF EXISTS ac_element_fk;
\ No newline at end of file
index 60ab374..f8736ca 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.nodetemplatestate DROP CONSTRAINT IF EXISTS dt_element_fk;
\ No newline at end of file
+ALTER TABLE nodetemplatestate DROP CONSTRAINT IF EXISTS dt_element_fk;
\ No newline at end of file
index 1c54ba3..60e00ee 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.participantsupportedacelements DROP CONSTRAINT IF EXISTS supported_element_fk;
\ No newline at end of file
+ALTER TABLE participantsupportedacelements DROP CONSTRAINT IF EXISTS supported_element_fk;
\ No newline at end of file
index 93aab9d..37dc296 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.automationcomposition (instanceId VARCHAR(255) NOT NULL, compositionId VARCHAR(255), compositionTargetId VARCHAR(255), deployState SMALLINT DEFAULT NULL, description VARCHAR(255), lockState SMALLINT DEFAULT NULL, name VARCHAR(255), restarting BOOLEAN, stateChangeResult SMALLINT DEFAULT NULL, version VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITION PRIMARY KEY (instanceId));
\ No newline at end of file
+CREATE TABLE automationcomposition (instanceId VARCHAR(255) NOT NULL, compositionId VARCHAR(255), compositionTargetId VARCHAR(255), deployState SMALLINT DEFAULT NULL, description VARCHAR(255), lockState SMALLINT DEFAULT NULL, name VARCHAR(255), restarting BOOLEAN, stateChangeResult SMALLINT DEFAULT NULL, version VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITION PRIMARY KEY (instanceId));
\ No newline at end of file
index 0f9f3dd..fc48683 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.automationcompositiondefinition (compositionId VARCHAR(255) NOT NULL, name VARCHAR(255), restarting BOOLEAN, serviceTemplate TEXT, state SMALLINT DEFAULT NULL, stateChangeResult SMALLINT DEFAULT NULL, version VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITIONDEFINITION PRIMARY KEY (compositionId));
\ No newline at end of file
+CREATE TABLE automationcompositiondefinition (compositionId VARCHAR(255) NOT NULL, name VARCHAR(255), restarting BOOLEAN, serviceTemplate TEXT, state SMALLINT DEFAULT NULL, stateChangeResult SMALLINT DEFAULT NULL, version VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITIONDEFINITION PRIMARY KEY (compositionId));
\ No newline at end of file
index a37eb39..302fcbc 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.automationcompositionelement (elementId VARCHAR(255) NOT NULL, definition_name VARCHAR(255), definition_version VARCHAR(255), deployState SMALLINT DEFAULT NULL, description VARCHAR(255), instanceId VARCHAR(255), lockState SMALLINT DEFAULT NULL, message VARCHAR(255), operationalState VARCHAR(255), outProperties TEXT, participantId VARCHAR(255), properties TEXT, restarting BOOLEAN, useState VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITIONELEMENT PRIMARY KEY (elementId));
\ No newline at end of file
+CREATE TABLE automationcompositionelement (elementId VARCHAR(255) NOT NULL, definition_name VARCHAR(255), definition_version VARCHAR(255), deployState SMALLINT DEFAULT NULL, description VARCHAR(255), instanceId VARCHAR(255), lockState SMALLINT DEFAULT NULL, message VARCHAR(255), operationalState VARCHAR(255), outProperties TEXT, participantId VARCHAR(255), properties TEXT, restarting BOOLEAN, useState VARCHAR(255), CONSTRAINT PK_AUTOMATIONCOMPOSITIONELEMENT PRIMARY KEY (elementId));
\ No newline at end of file
index c9f7919..d5454af 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.nodetemplatestate (nodeTemplateStateId VARCHAR(255) NOT NULL, compositionId VARCHAR(255), message VARCHAR(255), nodeTemplate_name VARCHAR(255), nodeTemplate_version VARCHAR(255), outProperties TEXT, participantId VARCHAR(255), restarting BOOLEAN, state SMALLINT DEFAULT NULL, CONSTRAINT PK_NODETEMPLATESTATE PRIMARY KEY (nodeTemplateStateId));
\ No newline at end of file
+CREATE TABLE nodetemplatestate (nodeTemplateStateId VARCHAR(255) NOT NULL, compositionId VARCHAR(255), message VARCHAR(255), nodeTemplate_name VARCHAR(255), nodeTemplate_version VARCHAR(255), outProperties TEXT, participantId VARCHAR(255), restarting BOOLEAN, state SMALLINT DEFAULT NULL, CONSTRAINT PK_NODETEMPLATESTATE PRIMARY KEY (nodeTemplateStateId));
\ No newline at end of file
index e7d4a97..08a8cf0 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.participant (participantId VARCHAR(255) NOT NULL, description VARCHAR(255), participantState SMALLINT DEFAULT NULL, CONSTRAINT PK_PARTICIPANT PRIMARY KEY (participantId));
\ No newline at end of file
+CREATE TABLE participant (participantId VARCHAR(255) NOT NULL, description VARCHAR(255), participantState SMALLINT DEFAULT NULL, CONSTRAINT PK_PARTICIPANT PRIMARY KEY (participantId));
\ No newline at end of file
index 1ad60c6..fbda69d 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE TABLE clampacm.participantsupportedacelements (id VARCHAR(255) NOT NULL, participantId VARCHAR(255), typeName VARCHAR(255), typeVersion VARCHAR(255), CONSTRAINT PK_PARTICIPANTSUPPORTEDACELEMENTS PRIMARY KEY (id));
\ No newline at end of file
+CREATE TABLE participantsupportedacelements (id VARCHAR(255) NOT NULL, participantId VARCHAR(255), typeName VARCHAR(255), typeVersion VARCHAR(255), CONSTRAINT PK_PARTICIPANTSUPPORTEDACELEMENTS PRIMARY KEY (id));
\ No newline at end of file
index e5785f9..fce9971 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE INDEX ac_compositionId ON clampacm.automationcomposition(compositionId);
\ No newline at end of file
+CREATE INDEX ac_compositionId ON automationcomposition(compositionId);
\ No newline at end of file
index 4c2c2bc..520019b 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE INDEX ac_element_fk ON clampacm.automationcompositionelement(instanceId);
\ No newline at end of file
+CREATE INDEX ac_element_fk ON automationcompositionelement(instanceId);
\ No newline at end of file
index c67fdd6..cfbafea 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE INDEX dt_element_fk ON clampacm.nodetemplatestate(compositionId);
\ No newline at end of file
+CREATE INDEX dt_element_fk ON nodetemplatestate(compositionId);
\ No newline at end of file
index 2ecba6f..13e1905 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-CREATE INDEX supported_element_fk ON clampacm.participantsupportedacelements(participantId);
\ No newline at end of file
+CREATE INDEX supported_element_fk ON participantsupportedacelements(participantId);
\ No newline at end of file
index 6315271..f6a24b9 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.automationcompositionelement ADD CONSTRAINT ac_element_fk FOREIGN KEY (instanceId) REFERENCES clampacm.automationcomposition (instanceId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file
+ALTER TABLE automationcompositionelement ADD CONSTRAINT ac_element_fk FOREIGN KEY (instanceId) REFERENCES automationcomposition (instanceId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file
index 8581deb..5f294ce 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.nodetemplatestate ADD CONSTRAINT dt_element_fk FOREIGN KEY (compositionId) REFERENCES clampacm.automationcompositiondefinition (compositionId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file
+ALTER TABLE nodetemplatestate ADD CONSTRAINT dt_element_fk FOREIGN KEY (compositionId) REFERENCES automationcompositiondefinition (compositionId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file
index 15f284a..dd60a3d 100644 (file)
@@ -17,4 +17,4 @@
  *  ============LICENSE_END=========================================================
  */
 
-ALTER TABLE clampacm.participantsupportedacelements ADD CONSTRAINT supported_element_fk FOREIGN KEY (participantId) REFERENCES clampacm.participant (participantId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file
+ALTER TABLE participantsupportedacelements ADD CONSTRAINT supported_element_fk FOREIGN KEY (participantId) REFERENCES participant (participantId) ON UPDATE RESTRICT ON DELETE RESTRICT;
\ No newline at end of file