From: danielhanrahan Date: Tue, 15 Jul 2025 09:31:14 +0000 (+0100) Subject: Add Liquibase to ACM runtime (Liquibase #3) X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F141498%2F5;p=policy%2Fclamp.git Add Liquibase to ACM runtime (Liquibase #3) This is the minimal work to get Liquibase running in ACM runtime: - Add Liquibase POM dependency. - Add Liquibase changelogs running all SQL files. - Pre-conditions are added for each set of changes, to allow upgrade from existing database created by DB-migrator to Liquibase. - Minor changes for some SQL files to be compatible with H2 database, used in tests (otherwise maven build would fail). - Disable hibernate ddl-auto so only Liquibase runs during tests. Issue-ID: POLICY-5398 Change-Id: Iaa1a589ee6e29516f10a2488f6577bbfa291e8ef Signed-off-by: danielhanrahan --- diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml index e8c34256d..0c6d942f3 100644 --- a/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml +++ b/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml @@ -18,7 +18,7 @@ spring: maximumPoolSize: 10 jpa: hibernate: - ddl-auto: update + ddl-auto: none naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy diff --git a/runtime-acm/pom.xml b/runtime-acm/pom.xml index f1304dbdb..a3faee7f2 100644 --- a/runtime-acm/pom.xml +++ b/runtime-acm/pom.xml @@ -272,6 +272,10 @@ kafka-clients runtime + + org.liquibase + liquibase-core + com.h2database h2 diff --git a/runtime-acm/src/main/resources/application.yaml b/runtime-acm/src/main/resources/application.yaml index 349f3f3bf..1edf36e11 100644 --- a/runtime-acm/src/main/resources/application.yaml +++ b/runtime-acm/src/main/resources/application.yaml @@ -20,7 +20,7 @@ spring: maximumPoolSize: 10 jpa: hibernate: - ddl-auto: update + ddl-auto: none naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy 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 510a7d3ae..5b251f61a 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 @@ -17,5 +17,6 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE automationcomposition ADD lastMsg timestamp without time zone DEFAULT Now(), ADD phase SMALLINT DEFAULT 0; +ALTER TABLE automationcomposition ADD lastMsg timestamp without time zone DEFAULT Now(); +ALTER TABLE automationcomposition ADD phase SMALLINT DEFAULT 0; UPDATE automationcomposition SET restarting = NULL; 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 f60aae878..af5f7cefa 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 @@ -17,4 +17,5 @@ * ============LICENSE_END========================================================= */ -ALTER TABLE automationcompositionelement ADD subState SMALLINT DEFAULT NULL, ADD stage SMALLINT DEFAULT NULL; +ALTER TABLE automationcompositionelement ADD subState SMALLINT DEFAULT NULL; +ALTER TABLE automationcompositionelement ADD stage SMALLINT DEFAULT 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 d44d6bc11..1b81716e3 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 @@ -17,7 +17,7 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE IF NOT EXISTS message ( +CREATE TABLE message ( messageId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, lastMsg timestamp without time zone NOT NULL DEFAULT now(), 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 c5dbb2e87..2155dd209 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 @@ -17,7 +17,7 @@ * ============LICENSE_END========================================================= */ -CREATE TABLE IF NOT EXISTS messagejob ( +CREATE TABLE messagejob ( jobId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, jobStarted timestamp without time zone NOT NULL DEFAULT now(), 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 d346c43a2..174935191 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 @@ -22,4 +22,4 @@ CREATE TABLE automationcompositionrollback ( 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 09a9d9210..31f2d1693 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 @@ -24,16 +24,15 @@ 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, - ALTER COLUMN name SET DEFAULT '', - ALTER COLUMN name SET NOT NULL, - ALTER COLUMN version SET DEFAULT '1.0.0', - ALTER COLUMN version SET NOT NULL, - ALTER COLUMN deployState SET DEFAULT 2, - ALTER COLUMN deployState SET NOT NULL, - ALTER COLUMN lockState SET DEFAULT 4, - ALTER COLUMN lockState SET NOT NULL, - ALTER COLUMN SubState SET DEFAULT 0, - ALTER COLUMN SubState SET NOT NULL, - ALTER COLUMN lastMsg SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN compositionid SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN name SET DEFAULT ''; +ALTER TABLE automationcomposition ALTER COLUMN name SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN version SET DEFAULT '1.0.0'; +ALTER TABLE automationcomposition ALTER COLUMN version SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN deployState SET DEFAULT 2; +ALTER TABLE automationcomposition ALTER COLUMN deployState SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN lockState SET DEFAULT 4; +ALTER TABLE automationcomposition ALTER COLUMN lockState SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN SubState SET DEFAULT 0; +ALTER TABLE automationcomposition ALTER COLUMN SubState SET NOT NULL; +ALTER TABLE automationcomposition ALTER COLUMN lastMsg 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 8e0811a3b..cf2b7cb95 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 @@ -23,18 +23,17 @@ UPDATE automationcompositionelement SET deploystate = 2 WHERE deploystate IS NUL 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, - ALTER COLUMN definition_name SET DEFAULT '', - ALTER COLUMN definition_version SET NOT NULL, - ALTER COLUMN definition_version SET DEFAULT '0.0.0', - ALTER COLUMN deploystate SET NOT NULL, - ALTER COLUMN deployState SET DEFAULT 2, - ALTER COLUMN lockState SET NOT NULL, - ALTER COLUMN lockState SET DEFAULT 4, - ALTER COLUMN substate SET NOT NULL, - ALTER COLUMN substate SET DEFAULT 0, - ALTER COLUMN outproperties SET NOT NULL, - ALTER COLUMN outproperties SET DEFAULT '{}', - ALTER COLUMN properties SET NOT NULL, - ALTER COLUMN properties SET DEFAULT '{}'; +ALTER TABLE automationcompositionelement ALTER COLUMN definition_name SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN definition_name SET DEFAULT ''; +ALTER TABLE automationcompositionelement ALTER COLUMN definition_version SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN definition_version SET DEFAULT '0.0.0'; +ALTER TABLE automationcompositionelement ALTER COLUMN deploystate SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN deployState SET DEFAULT 2; +ALTER TABLE automationcompositionelement ALTER COLUMN lockState SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN lockState SET DEFAULT 4; +ALTER TABLE automationcompositionelement ALTER COLUMN substate SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN substate SET DEFAULT 0; +ALTER TABLE automationcompositionelement ALTER COLUMN outproperties SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN outproperties SET DEFAULT '{}'; +ALTER TABLE automationcompositionelement ALTER COLUMN properties SET NOT NULL; +ALTER TABLE automationcompositionelement ALTER COLUMN properties SET DEFAULT '{}'; 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 00c73cb00..7f5a03c02 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 @@ -23,13 +23,12 @@ 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, - ALTER COLUMN name SET DEFAULT '', - ALTER COLUMN version SET NOT NULL, - ALTER COLUMN version SET DEFAULT '1.0.0', - ALTER COLUMN state SET NOT NULL, - ALTER COLUMN state SET DEFAULT 0, - ALTER COLUMN serviceTemplate SET NOT NULL, - ALTER COLUMN serviceTemplate SET DEFAULT '', - ALTER COLUMN lastMsg SET NOT NULL; +ALTER TABLE automationcompositiondefinition ALTER COLUMN name SET NOT NULL; +ALTER TABLE automationcompositiondefinition ALTER COLUMN name SET DEFAULT ''; +ALTER TABLE automationcompositiondefinition ALTER COLUMN version SET NOT NULL; +ALTER TABLE automationcompositiondefinition ALTER COLUMN version SET DEFAULT '1.0.0'; +ALTER TABLE automationcompositiondefinition ALTER COLUMN state SET NOT NULL; +ALTER TABLE automationcompositiondefinition ALTER COLUMN state SET DEFAULT 0; +ALTER TABLE automationcompositiondefinition ALTER COLUMN serviceTemplate SET NOT NULL; +ALTER TABLE automationcompositiondefinition ALTER COLUMN serviceTemplate SET DEFAULT ''; +ALTER TABLE automationcompositiondefinition ALTER COLUMN lastMsg 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 6939f1c61..03bb998c9 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 @@ -22,12 +22,11 @@ UPDATE nodetemplatestate SET nodeTemplate_version = '1.0.0' WHERE nodeTemplate_v 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, - ALTER COLUMN nodeTemplate_name SET DEFAULT '', - ALTER COLUMN nodeTemplate_version SET NOT NULL, - ALTER COLUMN nodeTemplate_version SET DEFAULT '1.0.0', - ALTER COLUMN outProperties SET NOT NULL, - ALTER COLUMN outProperties SET DEFAULT '{}', - ALTER COLUMN state SET NOT NULL, - ALTER COLUMN state SET DEFAULT 0; +ALTER TABLE nodetemplatestate ALTER COLUMN nodeTemplate_name SET NOT NULL; +ALTER TABLE nodetemplatestate ALTER COLUMN nodeTemplate_name SET DEFAULT ''; +ALTER TABLE nodetemplatestate ALTER COLUMN nodeTemplate_version SET NOT NULL; +ALTER TABLE nodetemplatestate ALTER COLUMN nodeTemplate_version SET DEFAULT '1.0.0'; +ALTER TABLE nodetemplatestate ALTER COLUMN outProperties SET NOT NULL; +ALTER TABLE nodetemplatestate ALTER COLUMN outProperties SET DEFAULT '{}'; +ALTER TABLE nodetemplatestate ALTER COLUMN state SET NOT NULL; +ALTER TABLE nodetemplatestate ALTER COLUMN state SET DEFAULT 0; 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 7660b6fe3..879050098 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 @@ -20,9 +20,8 @@ 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, - ALTER COLUMN participantId SET NOT NULL, - ALTER COLUMN participantId SET DEFAULT '', - ALTER COLUMN participantState SET NOT NULL, - ALTER COLUMN participantState SET DEFAULT 1; +ALTER TABLE participantreplica ALTER COLUMN lastMsg SET NOT NULL; +ALTER TABLE participantreplica ALTER COLUMN participantId SET NOT NULL; +ALTER TABLE participantreplica ALTER COLUMN participantId SET DEFAULT ''; +ALTER TABLE participantreplica ALTER COLUMN participantState SET NOT NULL; +ALTER TABLE participantreplica ALTER COLUMN participantState SET DEFAULT 1; 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 8b7a42c7d..8ded46afe 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 @@ -20,10 +20,9 @@ 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, - ALTER COLUMN participantId SET DEFAULT '', - ALTER COLUMN typeName SET NOT NULL, - ALTER COLUMN typeName SET DEFAULT '', - ALTER COLUMN typeVersion SET NOT NULL, - ALTER COLUMN typeVersion SET DEFAULT '1.0.0'; +ALTER TABLE participantsupportedacelements ALTER COLUMN participantId SET NOT NULL; +ALTER TABLE participantsupportedacelements ALTER COLUMN participantId SET DEFAULT ''; +ALTER TABLE participantsupportedacelements ALTER COLUMN typeName SET NOT NULL; +ALTER TABLE participantsupportedacelements ALTER COLUMN typeName SET DEFAULT ''; +ALTER TABLE participantsupportedacelements ALTER COLUMN typeVersion SET NOT NULL; +ALTER TABLE participantsupportedacelements ALTER COLUMN typeVersion SET DEFAULT '1.0.0'; diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1400.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1400.yaml new file mode 100644 index 000000000..fb767de0e --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1400.yaml @@ -0,0 +1,54 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1400 + preConditions: + not: + tableExists: + tableName: automationcomposition + onFail: MARK_RAN + changes: + - sqlFile: + path: db/changelog/1400/upgrade/0100-automationcomposition.sql + - sqlFile: + path: db/changelog/1400/upgrade/0200-automationcompositiondefinition.sql + - sqlFile: + path: db/changelog/1400/upgrade/0300-automationcompositionelement.sql + - sqlFile: + path: db/changelog/1400/upgrade/0400-nodetemplatestate.sql + - sqlFile: + path: db/changelog/1400/upgrade/0500-participant.sql + - sqlFile: + path: db/changelog/1400/upgrade/0600-participantsupportedelements.sql + - sqlFile: + path: db/changelog/1400/upgrade/0700-ac_compositionId_index.sql + - sqlFile: + path: db/changelog/1400/upgrade/0800-ac_element_fk_index.sql + - sqlFile: + path: db/changelog/1400/upgrade/0900-dt_element_fk_index.sql + - sqlFile: + path: db/changelog/1400/upgrade/1000-supported_element_fk_index.sql + - sqlFile: + path: db/changelog/1400/upgrade/1100-automationcompositionelement_fk.sql + - sqlFile: + path: db/changelog/1400/upgrade/1200-nodetemplate_fk.sql + - sqlFile: + path: db/changelog/1400/upgrade/1300-participantsupportedelements_fk.sql diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1500.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1500.yaml new file mode 100644 index 000000000..2aeed5c64 --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1500.yaml @@ -0,0 +1,44 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1500 + preConditions: + not: + tableExists: + tableName: participantreplica + onFail: MARK_RAN + changes: + - sqlFile: + path: db/changelog/1500/upgrade/0100-automationcomposition.sql + - sqlFile: + path: db/changelog/1500/upgrade/0200-automationcompositiondefinition.sql + - sqlFile: + path: db/changelog/1500/upgrade/0300-participantreplica.sql + - sqlFile: + path: db/changelog/1500/upgrade/0400-participant.sql + - sqlFile: + path: db/changelog/1500/upgrade/0500-participant_replica_fk_index.sql + - sqlFile: + path: db/changelog/1500/upgrade/0600-participant_replica_fk.sql + - sqlFile: + path: db/changelog/1500/upgrade/0700-automationcompositionelement.sql + - sqlFile: + path: db/changelog/1500/upgrade/0800-nodetemplatestate.sql diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1600.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1600.yaml new file mode 100644 index 000000000..1cbfddbf4 --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1600.yaml @@ -0,0 +1,33 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1600 + preConditions: + not: + columnExists: + tableName: automationcomposition + columnName: subState + onFail: MARK_RAN + changes: + - sqlFile: + path: db/changelog/1600/upgrade/0100-automationcomposition.sql + - sqlFile: + path: db/changelog/1600/upgrade/0200-automationcompositionelement.sql diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1601.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1601.yaml new file mode 100644 index 000000000..bf21bee0d --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1601.yaml @@ -0,0 +1,27 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1601 + changes: + - sqlFile: + path: db/changelog/1601/upgrade/0100-automationcomposition.sql + - sqlFile: + path: db/changelog/1601/upgrade/0200-automationcompositionelement.sql diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1700.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1700.yaml new file mode 100644 index 000000000..26a4973db --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1700.yaml @@ -0,0 +1,34 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1700 + preConditions: + not: + tableExists: + tableName: message + onFail: MARK_RAN + changes: + - sqlFile: + path: db/changelog/1700/upgrade/0100-message.sql + - sqlFile: + path: db/changelog/1700/upgrade/0200-messagejob.sql + - sqlFile: + path: db/changelog/1700/upgrade/0300-messagejob_identificationId_index.sql diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml new file mode 100644 index 000000000..dfc4b263a --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml @@ -0,0 +1,46 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - changeSet: + author: policy + id: 1701 + preConditions: + not: + tableExists: + tableName: automationcompositionrollback + onFail: MARK_RAN + changes: + - sqlFile: + path: db/changelog/1701/upgrade/0100-automationcompositionrollback.sql + - sqlFile: + path: db/changelog/1701/upgrade/0200-automationcomposition.sql + - sqlFile: + path: db/changelog/1701/upgrade/0300-automationcompositionelement.sql + - sqlFile: + path: db/changelog/1701/upgrade/0400-automationcomposition_fk.sql + - sqlFile: + path: db/changelog/1701/upgrade/0500-automationcompositiondefinition.sql + - sqlFile: + path: db/changelog/1701/upgrade/0600-nodetemplatestate.sql + - sqlFile: + path: db/changelog/1701/upgrade/0700-mb_identificationId_index.sql + - sqlFile: + path: db/changelog/1701/upgrade/0800-participantreplica.sql + - sqlFile: + path: db/changelog/1701/upgrade/0900-participantsupportedacelements.sql diff --git a/runtime-acm/src/main/resources/db/changelog/db.changelog-master.yaml b/runtime-acm/src/main/resources/db/changelog/db.changelog-master.yaml new file mode 100644 index 000000000..d50d972d2 --- /dev/null +++ b/runtime-acm/src/main/resources/db/changelog/db.changelog-master.yaml @@ -0,0 +1,31 @@ +# ============LICENSE_START======================================================= +# 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +databaseChangeLog: + - include: + file: db/changelog/changelog-1400.yaml + - include: + file: db/changelog/changelog-1500.yaml + - include: + file: db/changelog/changelog-1600.yaml + - include: + file: db/changelog/changelog-1601.yaml + - include: + file: db/changelog/changelog-1700.yaml + - include: + file: db/changelog/changelog-1701.yaml diff --git a/runtime-acm/src/test/resources/application-prometheus-noauth.yaml b/runtime-acm/src/test/resources/application-prometheus-noauth.yaml index a75c5d36f..9815fe343 100644 --- a/runtime-acm/src/test/resources/application-prometheus-noauth.yaml +++ b/runtime-acm/src/test/resources/application-prometheus-noauth.yaml @@ -7,7 +7,7 @@ spring: maximumPoolSize: 3 jpa: hibernate: - ddl-auto: create + ddl-auto: none open-in-view: false tracing: @@ -19,4 +19,4 @@ tracing: jaeger-remote: endpoint: http://jaeger:14250 -basicAuth: false \ No newline at end of file +basicAuth: false diff --git a/runtime-acm/src/test/resources/application-tracing.yaml b/runtime-acm/src/test/resources/application-tracing.yaml index d24fe9c53..590974cbb 100644 --- a/runtime-acm/src/test/resources/application-tracing.yaml +++ b/runtime-acm/src/test/resources/application-tracing.yaml @@ -7,7 +7,7 @@ spring: maximumPoolSize: 3 jpa: hibernate: - ddl-auto: create-drop + ddl-auto: none open-in-view: false management: @@ -24,4 +24,4 @@ tracing: protocol: grpc sampler: jaeger-remote: - endpoint: http://jaeger:14250 \ No newline at end of file + endpoint: http://jaeger:14250