From: danielhanrahan Date: Tue, 15 Jul 2025 09:28:44 +0000 (+0100) Subject: Clean formatting in SQL (Liquibase #2) X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F141499%2F3;p=policy%2Fclamp.git Clean formatting in SQL (Liquibase #2) This cleans up formatting in SQL to make further code reviews easier. - whitespace formatting changes - consistent use of uppercase for SQL commands - update copyrights for OpenInfra foundation Issue-ID: POLICY-5398 Change-Id: I52b852319d9e2047afd00ad6c4790b16ee161d99 Signed-off-by: danielhanrahan --- diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0100-automationcomposition.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0100-automationcomposition.sql index 37dc29687..414247e51 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0100-automationcomposition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0100-automationcomposition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,16 @@ * ============LICENSE_END========================================================= */ -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 +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) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0200-automationcompositiondefinition.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0200-automationcompositiondefinition.sql index fc4868328..7ae65f0c5 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0200-automationcompositiondefinition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0200-automationcompositiondefinition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,13 @@ * ============LICENSE_END========================================================= */ -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 +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) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0300-automationcompositionelement.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0300-automationcompositionelement.sql index 302fcbc0c..41c4adc35 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0300-automationcompositionelement.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0300-automationcompositionelement.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,20 @@ * ============LICENSE_END========================================================= */ -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 +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) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0400-nodetemplatestate.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0400-nodetemplatestate.sql index d5454af4d..9af1632b8 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0400-nodetemplatestate.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0400-nodetemplatestate.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,15 @@ * ============LICENSE_END========================================================= */ -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 +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) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0500-participant.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0500-participant.sql index 08a8cf016..5f98f57a4 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0500-participant.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0500-participant.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -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 +CREATE TABLE participant ( + participantId VARCHAR(255) NOT NULL, + description VARCHAR(255), + participantState SMALLINT DEFAULT NULL, + CONSTRAINT PK_PARTICIPANT PRIMARY KEY (participantId) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0600-participantsupportedelements.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0600-participantsupportedelements.sql index fbda69d5e..c6ae4ce57 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0600-participantsupportedelements.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0600-participantsupportedelements.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,10 @@ * ============LICENSE_END========================================================= */ -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 +CREATE TABLE participantsupportedacelements ( + id VARCHAR(255) NOT NULL, + participantId VARCHAR(255), + typeName VARCHAR(255), + typeVersion VARCHAR(255), + CONSTRAINT PK_PARTICIPANTSUPPORTEDACELEMENTS PRIMARY KEY (id) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0700-ac_compositionId_index.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0700-ac_compositionId_index.sql index fce99716c..4eeb41dd2 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0700-ac_compositionId_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0700-ac_compositionId_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -CREATE INDEX ac_compositionId ON automationcomposition(compositionId); \ No newline at end of file +CREATE INDEX ac_compositionId ON automationcomposition(compositionId); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0800-ac_element_fk_index.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0800-ac_element_fk_index.sql index 520019b82..316a393ce 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0800-ac_element_fk_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0800-ac_element_fk_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -CREATE INDEX ac_element_fk ON automationcompositionelement(instanceId); \ No newline at end of file +CREATE INDEX ac_element_fk ON automationcompositionelement(instanceId); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0900-dt_element_fk_index.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0900-dt_element_fk_index.sql index cfbafea5e..cac331933 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0900-dt_element_fk_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/0900-dt_element_fk_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -CREATE INDEX dt_element_fk ON nodetemplatestate(compositionId); \ No newline at end of file +CREATE INDEX dt_element_fk ON nodetemplatestate(compositionId); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1000-supported_element_fk_index.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1000-supported_element_fk_index.sql index 13e1905fb..a1e66c5ef 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1000-supported_element_fk_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1000-supported_element_fk_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ -CREATE INDEX supported_element_fk ON participantsupportedacelements(participantId); \ No newline at end of file +CREATE INDEX supported_element_fk ON participantsupportedacelements(participantId); diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1100-automationcompositionelement_fk.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1100-automationcompositionelement_fk.sql index f6a24b961..b67d208b4 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1100-automationcompositionelement_fk.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1100-automationcompositionelement_fk.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -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 +ALTER TABLE automationcompositionelement + ADD CONSTRAINT ac_element_fk + FOREIGN KEY (instanceId) + REFERENCES automationcomposition (instanceId) + ON UPDATE RESTRICT + ON DELETE RESTRICT; diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1200-nodetemplate_fk.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1200-nodetemplate_fk.sql index 5f294ced1..da9ee2ff6 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1200-nodetemplate_fk.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1200-nodetemplate_fk.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -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 +ALTER TABLE nodetemplatestate + ADD CONSTRAINT dt_element_fk + FOREIGN KEY (compositionId) + REFERENCES automationcompositiondefinition (compositionId) + ON UPDATE RESTRICT + ON DELETE RESTRICT; diff --git a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1300-participantsupportedelements_fk.sql b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1300-participantsupportedelements_fk.sql index dd60a3dac..8099b58aa 100644 --- a/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1300-participantsupportedelements_fk.sql +++ b/runtime-acm/src/main/resources/db/changelog/1400/upgrade/1300-participantsupportedelements_fk.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -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 +ALTER TABLE participantsupportedacelements + ADD CONSTRAINT supported_element_fk + FOREIGN KEY (participantId) + REFERENCES participant (participantId) + ON UPDATE RESTRICT + ON DELETE RESTRICT; diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0100-automationcomposition.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0100-automationcomposition.sql index c1e4bb431..510a7d3ae 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0100-automationcomposition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0100-automationcomposition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0200-automationcompositiondefinition.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0200-automationcompositiondefinition.sql index 25a773bdb..5acec8cff 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0200-automationcompositiondefinition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0200-automationcompositiondefinition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0300-participantreplica.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0300-participantreplica.sql index 4543272b0..d6247293a 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0300-participantreplica.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0300-participantreplica.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,11 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE participantreplica (replicaId varchar(255) NOT NULL, lastMsg timestamp without time zone DEFAULT Now(), participantId varchar(255) DEFAULT NULL, participantState SMALLINT DEFAULT NULL, CONSTRAINT PK_PARTICIPANT_REPLICA PRIMARY KEY (replicaId)); +CREATE TABLE participantreplica ( + replicaId varchar(255) NOT NULL, + lastMsg timestamp without time zone DEFAULT Now(), + participantId varchar(255) DEFAULT NULL, + participantState SMALLINT DEFAULT NULL, + CONSTRAINT PK_PARTICIPANT_REPLICA PRIMARY KEY (replicaId) +); + diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0400-participant.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0400-participant.sql index 97ae43a37..214fa0787 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0400-participant.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0400-participant.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0500-participant_replica_fk_index.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0500-participant_replica_fk_index.sql index bc506e996..071535153 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0500-participant_replica_fk_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0500-participant_replica_fk_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0600-participant_replica_fk.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0600-participant_replica_fk.sql index 3341d8e09..274711931 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0600-participant_replica_fk.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0600-participant_replica_fk.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE participantreplica ADD CONSTRAINT participant_replica_fk FOREIGN KEY (participantId) REFERENCES participant (participantId) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE participantreplica + ADD CONSTRAINT participant_replica_fk + FOREIGN KEY (participantId) + REFERENCES participant (participantId) + ON UPDATE RESTRICT + ON DELETE RESTRICT; diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0700-automationcompositionelement.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0700-automationcompositionelement.sql index 03ab8a490..44090a22f 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0700-automationcompositionelement.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0700-automationcompositionelement.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0800-nodetemplatestate.sql b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0800-nodetemplatestate.sql index 1114a5976..898a51661 100644 --- a/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0800-nodetemplatestate.sql +++ b/runtime-acm/src/main/resources/db/changelog/1500/upgrade/0800-nodetemplatestate.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0100-automationcomposition.sql b/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0100-automationcomposition.sql index b3ec5f96f..ea392a42f 100644 --- a/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0100-automationcomposition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0100-automationcomposition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0200-automationcompositionelement.sql b/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0200-automationcompositionelement.sql index 3e91bbf7b..f60aae878 100644 --- a/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0200-automationcompositionelement.sql +++ b/runtime-acm/src/main/resources/db/changelog/1600/upgrade/0200-automationcompositionelement.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0100-automationcomposition.sql b/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0100-automationcomposition.sql index e4aae8fc7..6ff43b655 100644 --- a/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0100-automationcomposition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0100-automationcomposition.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2025 Nordix Foundation + * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ * ============LICENSE_END========================================================= */ - UPDATE automationcomposition SET substate=0 WHERE substate is NULL; +UPDATE automationcomposition SET subState=0 WHERE subState is NULL; diff --git a/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0200-automationcompositionelement.sql b/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0200-automationcompositionelement.sql index ad9469cda..25c98494f 100644 --- a/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0200-automationcompositionelement.sql +++ b/runtime-acm/src/main/resources/db/changelog/1601/upgrade/0200-automationcompositionelement.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2025 Nordix Foundation + * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,5 +17,5 @@ * ============LICENSE_END========================================================= */ - UPDATE automationcompositionelement SET subState=0 WHERE substate is NULL; - UPDATE automationcompositionelement SET stage=0 WHERE stage is NULL; +UPDATE automationcompositionelement SET subState=0 WHERE subState is NULL; +UPDATE automationcompositionelement SET stage=0 WHERE stage is NULL; diff --git a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0100-message.sql b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0100-message.sql index f13f3b8ec..d44d6bc11 100644 --- a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0100-message.sql +++ b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0100-message.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2025 Nordix Foundation + * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,10 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE IF NOT EXISTS message (messageId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, lastMsg timestamp without time zone NOT NULL DEFAULT now(), docMessage text NOT NULL, CONSTRAINT PK_MESSAGE PRIMARY KEY (messageId)); +CREATE TABLE IF NOT EXISTS message ( + messageId varchar(255) NOT NULL, + identificationId varchar(255) NOT NULL, + lastMsg timestamp without time zone NOT NULL DEFAULT now(), + docMessage text NOT NULL, + CONSTRAINT PK_MESSAGE PRIMARY KEY (messageId) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0200-messagejob.sql b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0200-messagejob.sql index ea6d7baaa..c5dbb2e87 100644 --- a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0200-messagejob.sql +++ b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0200-messagejob.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2025 Nordix Foundation + * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE IF NOT EXISTS messagejob (jobId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, jobStarted timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT PK_MESSAGE_JOB PRIMARY KEY (jobId)); +CREATE TABLE IF NOT EXISTS messagejob ( + jobId varchar(255) NOT NULL, + identificationId varchar(255) NOT NULL, + jobStarted timestamp without time zone NOT NULL DEFAULT now(), + CONSTRAINT PK_MESSAGE_JOB PRIMARY KEY (jobId) +); diff --git a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0300-messagejob_identificationId_index.sql b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0300-messagejob_identificationId_index.sql index 4d512dc52..26ad6db84 100644 --- a/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0300-messagejob_identificationId_index.sql +++ b/runtime-acm/src/main/resources/db/changelog/1700/upgrade/0300-messagejob_identificationId_index.sql @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2025 Nordix Foundation + * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0100-automationcompositionrollback.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0100-automationcompositionrollback.sql index 1ecd52863..d346c43a2 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0100-automationcompositionrollback.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0100-automationcompositionrollback.sql @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE automationcompositionrollback (instanceId VARCHAR(255) NOT NULL, compositionId VARCHAR(255) NOT NULL, elements TEXT NOT NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITION_ROLLBACK PRIMARY KEY (instanceId)) WITHOUT OIDS; \ No newline at end of file +CREATE TABLE automationcompositionrollback ( + instanceId VARCHAR(255) NOT NULL, + compositionId VARCHAR(255) NOT NULL, + elements TEXT NOT NULL, + CONSTRAINT PK_AUTOMATIONCOMPOSITION_ROLLBACK PRIMARY KEY (instanceId) +) WITHOUT OIDS; diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0200-automationcomposition.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0200-automationcomposition.sql index 3bc96f293..09a9d9210 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0200-automationcomposition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0200-automationcomposition.sql @@ -17,12 +17,12 @@ * ============LICENSE_END========================================================= */ -update automationcomposition set deployState = 2 where deployState is null; -update automationcomposition set lockState = 4 where lockState is null; -update automationcomposition set name = '' where name is null; -update automationcomposition set version = '1.0.0' where version is null; -update automationcomposition set lastMsg = now() where lastMsg is null; -update automationcomposition set subState = 0 where subState is null; +UPDATE automationcomposition SET deployState = 2 WHERE deployState IS NULL; +UPDATE automationcomposition SET lockState = 4 WHERE lockState IS NULL; +UPDATE automationcomposition SET name = '' WHERE name IS NULL; +UPDATE automationcomposition SET version = '1.0.0' WHERE version IS NULL; +UPDATE automationcomposition SET lastMsg = now() WHERE lastMsg IS NULL; +UPDATE automationcomposition SET subState = 0 WHERE subState IS NULL; ALTER TABLE automationcomposition ALTER COLUMN compositionid SET NOT NULL, diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0300-automationcompositionelement.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0300-automationcompositionelement.sql index 917645466..8e0811a3b 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0300-automationcompositionelement.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0300-automationcompositionelement.sql @@ -17,11 +17,11 @@ * ============LICENSE_END========================================================= */ -update automationcompositionelement set definition_name = '' where definition_name is null; -update automationcompositionelement set definition_version = '0.0.0' where definition_version is null; -update automationcompositionelement set deploystate = 2 where deploystate is null; -update automationcompositionelement set lockState = 4 where lockState is null; -update automationcompositionelement set subState = 0 where subState is null; +UPDATE automationcompositionelement SET definition_name = '' WHERE definition_name IS NULL; +UPDATE automationcompositionelement SET definition_version = '0.0.0' WHERE definition_version IS NULL; +UPDATE automationcompositionelement SET deploystate = 2 WHERE deploystate IS NULL; +UPDATE automationcompositionelement SET lockState = 4 WHERE lockState IS NULL; +UPDATE automationcompositionelement SET subState = 0 WHERE subState IS NULL; ALTER TABLE automationcompositionelement ALTER COLUMN definition_name SET NOT NULL, diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0400-automationcomposition_fk.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0400-automationcomposition_fk.sql index 0b0fbddc8..8c1db5648 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0400-automationcomposition_fk.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0400-automationcomposition_fk.sql @@ -17,4 +17,9 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE automationcomposition ADD CONSTRAINT ac_composition_fk FOREIGN KEY (compositionId) REFERENCES automationcompositiondefinition (compositionId) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE automationcomposition + ADD CONSTRAINT ac_composition_fk + FOREIGN KEY (compositionId) + REFERENCES automationcompositiondefinition (compositionId) + ON UPDATE RESTRICT + ON DELETE RESTRICT; diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0500-automationcompositiondefinition.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0500-automationcompositiondefinition.sql index 99cdbf81b..00c73cb00 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0500-automationcompositiondefinition.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0500-automationcompositiondefinition.sql @@ -17,11 +17,11 @@ * ============LICENSE_END========================================================= */ -update automationcompositiondefinition set name = '' where name is null; -update automationcompositiondefinition set version = '1.0.0' where version is null; -update automationcompositiondefinition set state = 0 where state is null; -update automationcompositiondefinition set lastMsg = now() where lastMsg is null; -update automationcompositiondefinition set serviceTemplate = '' where serviceTemplate is null; +UPDATE automationcompositiondefinition SET name = '' WHERE name IS NULL; +UPDATE automationcompositiondefinition SET version = '1.0.0' WHERE version IS NULL; +UPDATE automationcompositiondefinition SET state = 0 WHERE state IS NULL; +UPDATE automationcompositiondefinition SET lastMsg = now() WHERE lastMsg IS NULL; +UPDATE automationcompositiondefinition SET serviceTemplate = '' WHERE serviceTemplate IS NULL; ALTER TABLE automationcompositiondefinition ALTER COLUMN name SET NOT NULL, diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0600-nodetemplatestate.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0600-nodetemplatestate.sql index c72470dee..6939f1c61 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0600-nodetemplatestate.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0600-nodetemplatestate.sql @@ -17,10 +17,10 @@ * ============LICENSE_END========================================================= */ -update nodetemplatestate set nodeTemplate_name = '' where nodeTemplate_name is null; -update nodetemplatestate set nodeTemplate_version = '1.0.0' where nodeTemplate_version is null; -update nodetemplatestate set outProperties = '{}' where outProperties is null; -update nodetemplatestate set state = 0 where state is null; +UPDATE nodetemplatestate SET nodeTemplate_name = '' WHERE nodeTemplate_name IS NULL; +UPDATE nodetemplatestate SET nodeTemplate_version = '1.0.0' WHERE nodeTemplate_version IS NULL; +UPDATE nodetemplatestate SET outProperties = '{}' WHERE outProperties IS NULL; +UPDATE nodetemplatestate SET state = 0 WHERE state IS NULL; ALTER TABLE nodetemplatestate ALTER COLUMN nodeTemplate_name SET NOT NULL, diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0800-participantreplica.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0800-participantreplica.sql index 8a5055515..7660b6fe3 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0800-participantreplica.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0800-participantreplica.sql @@ -17,8 +17,8 @@ * ============LICENSE_END========================================================= */ -update participantreplica set lastMsg = now() where lastMsg is null; -update participantreplica set participantState = '1' where participantState is null; +UPDATE participantreplica SET lastMsg = now() WHERE lastMsg IS NULL; +UPDATE participantreplica SET participantState = '1' WHERE participantState IS NULL; ALTER TABLE participantreplica ALTER COLUMN lastMsg SET NOT NULL, diff --git a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0900-participantsupportedacelements.sql b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0900-participantsupportedacelements.sql index 9a4141967..8b7a42c7d 100644 --- a/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0900-participantsupportedacelements.sql +++ b/runtime-acm/src/main/resources/db/changelog/1701/upgrade/0900-participantsupportedacelements.sql @@ -17,8 +17,8 @@ * ============LICENSE_END========================================================= */ -update participantsupportedacelements set typeName = '' where typeName is null; -update participantsupportedacelements set typeVersion = '1.0.0' where typeVersion is null; +UPDATE participantsupportedacelements SET typeName = '' WHERE typeName IS NULL; +UPDATE participantsupportedacelements SET typeVersion = '1.0.0' WHERE typeVersion IS NULL; ALTER TABLE participantsupportedacelements ALTER COLUMN participantId SET NOT NULL,