diff options
Diffstat (limited to 'policy-db-migrator')
58 files changed, 1061 insertions, 12 deletions
diff --git a/policy-db-migrator/src/main/docker/Dockerfile b/policy-db-migrator/src/main/docker/Dockerfile index c234d215..81ea0e26 100644 --- a/policy-db-migrator/src/main/docker/Dockerfile +++ b/policy-db-migrator/src/main/docker/Dockerfile @@ -1,7 +1,8 @@ #------------------------------------------------------------------------------- # Dockerfile # ============LICENSE_START======================================================= -# Copyright (C) 2021-2023 Nordix Foundation. +# Copyright (C) 2021 Nordix Foundation. +# Modification Copyright 2021-2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,8 +54,10 @@ COPY --chown=policy:policy ./db-migrator $POLICY_BIN/ COPY --chown=policy:policy ./db-migrator-pg $POLICY_BIN/ COPY --chown=policy:policy ./prepare_upgrade.sh $POLICY_BIN/ COPY --chown=policy:policy ./prepare_downgrade.sh $POLICY_BIN/ -COPY --chown=policy:policy ./config/policyadmin/sql /home/policy/sql -COPY --chown=policy:policy ./config/policyadmin/postgres /home/policy/postgres +COPY --chown=policy:policy ./config/policyadmin/sql /home/policyadmin/sql +COPY --chown=policy:policy ./config/policyadmin/postgres /home/policyadmin/postgres +COPY --chown=policy:policy ./config/clampacm/sql /home/clampacm/sql +COPY --chown=policy:policy ./config/clampacm/postgres /home/clampacm/postgres WORKDIR $POLICY_BIN USER policy:policy diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0100-automationcomposition.sql new file mode 100644 index 00000000..f17216f9 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0100-automationcomposition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcomposition;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0200-automationcompositiondefinition.sql new file mode 100644 index 00000000..9ef6e9ca --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0200-automationcompositiondefinition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcompositiondefinition;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0300-automationcompositionelement.sql new file mode 100644 index 00000000..2255d085 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0300-automationcompositionelement.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcompositionelement;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0400-nodetemplatestate.sql new file mode 100644 index 00000000..7aee61ba --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0400-nodetemplatestate.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.nodetemplatestate;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0500-participant.sql new file mode 100644 index 00000000..3f20fefb --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0500-participant.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.participant;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0600-participantsupportedelements.sql new file mode 100644 index 00000000..e5ce88a6 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0600-participantsupportedelements.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.participantsupportedacelements;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0700-ac_compositionId_index.sql new file mode 100644 index 00000000..c21fd9e3 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0700-ac_compositionId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX IF EXISTS ac_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0800-ac_element_fk_index.sql new file mode 100644 index 00000000..c21fd9e3 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0800-ac_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX IF EXISTS ac_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0900-dt_element_fk_index.sql new file mode 100644 index 00000000..ed57c52f --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/0900-dt_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX IF EXISTS dt_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1000-supported_element_fk_index.sql new file mode 100644 index 00000000..41b93291 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1000-supported_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX IF EXISTS supported_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1100-automationcompositionelement_fk.sql new file mode 100644 index 00000000..c5b7eb30 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1100-automationcompositionelement_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.automationcompositionelement DROP CONSTRAINT IF EXISTS ac_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1200-nodetemplate_fk.sql new file mode 100644 index 00000000..60ab374d --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1200-nodetemplate_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.nodetemplatestate DROP CONSTRAINT IF EXISTS dt_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1300-participantsupportedelements_fk.sql new file mode 100644 index 00000000..1c54ba3f --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/downgrade/1300-participantsupportedelements_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.participantsupportedacelements DROP CONSTRAINT IF EXISTS supported_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0100-automationcomposition.sql new file mode 100644 index 00000000..93aab9db --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0100-automationcomposition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0200-automationcompositiondefinition.sql new file mode 100644 index 00000000..0f9f3ddf --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0200-automationcompositiondefinition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0300-automationcompositionelement.sql new file mode 100644 index 00000000..a37eb39d --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0300-automationcompositionelement.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0400-nodetemplatestate.sql new file mode 100644 index 00000000..c9f79194 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0400-nodetemplatestate.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0500-participant.sql new file mode 100644 index 00000000..e7d4a970 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0500-participant.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0600-participantsupportedelements.sql new file mode 100644 index 00000000..1ad60c63 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0600-participantsupportedelements.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0700-ac_compositionId_index.sql new file mode 100644 index 00000000..e5785f9f --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0700-ac_compositionId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX ac_compositionId ON clampacm.automationcomposition(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0800-ac_element_fk_index.sql new file mode 100644 index 00000000..4c2c2bc2 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0800-ac_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX ac_element_fk ON clampacm.automationcompositionelement(instanceId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0900-dt_element_fk_index.sql new file mode 100644 index 00000000..c67fdd62 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/0900-dt_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX dt_element_fk ON clampacm.nodetemplatestate(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1000-supported_element_fk_index.sql new file mode 100644 index 00000000..2ecba6f1 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1000-supported_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX supported_element_fk ON clampacm.participantsupportedacelements(participantId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1100-automationcompositionelement_fk.sql new file mode 100644 index 00000000..6315271b --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1100-automationcompositionelement_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1200-nodetemplate_fk.sql new file mode 100644 index 00000000..8581deb1 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1200-nodetemplate_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1300-participantsupportedelements_fk.sql new file mode 100644 index 00000000..15f284a0 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1400/upgrade/1300-participantsupportedelements_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0100-automationcomposition.sql new file mode 100644 index 00000000..f17216f9 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0100-automationcomposition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcomposition;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0200-automationcompositiondefinition.sql new file mode 100644 index 00000000..9ef6e9ca --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0200-automationcompositiondefinition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcompositiondefinition;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0300-automationcompositionelement.sql new file mode 100644 index 00000000..2255d085 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0300-automationcompositionelement.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.automationcompositionelement;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0400-nodetemplatestate.sql new file mode 100644 index 00000000..7aee61ba --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0400-nodetemplatestate.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.nodetemplatestate;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql new file mode 100644 index 00000000..3f20fefb --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0500-participant.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.participant;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql new file mode 100644 index 00000000..e5ce88a6 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0600-participantsupportedelements.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP TABLE clampacm.participantsupportedacelements;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql new file mode 100644 index 00000000..cadcea93 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX ac_element_fk ON clampacm.automationcompositionelement;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql new file mode 100644 index 00000000..cadcea93 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0800-ac_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX ac_element_fk ON clampacm.automationcompositionelement;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql new file mode 100644 index 00000000..9a573697 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0900-dt_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX dt_element_fk ON clampacm.nodetemplatestate;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql new file mode 100644 index 00000000..b5ecf01e --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1000-supported_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +DROP INDEX supported_element_fk ON clampacm.participantsupportedacelements;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql new file mode 100644 index 00000000..d37f4b11 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1100-automationcompositionelement_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.automationcompositionelement DROP FOREIGN KEY ac_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql new file mode 100644 index 00000000..c03da333 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1200-nodetemplate_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.nodetemplatestate DROP FOREIGN KEY dt_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql new file mode 100644 index 00000000..5e61ef17 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/1300-participantsupportedelements_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +ALTER TABLE clampacm.participantsupportedacelements DROP FOREIGN KEY supported_element_fk;
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql new file mode 100644 index 00000000..edaf2f5b --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0100-automationcomposition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.automationcomposition (instanceId VARCHAR(255) NOT NULL, compositionId VARCHAR(255) NULL, compositionTargetId VARCHAR(255) NULL, deployState TINYINT DEFAULT NULL NULL, `description` VARCHAR(255) NULL, lockState TINYINT DEFAULT NULL NULL, name VARCHAR(255) NULL, restarting BIT NULL, stateChangeResult TINYINT DEFAULT NULL NULL, version VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITION PRIMARY KEY (instanceId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql new file mode 100644 index 00000000..22f70b0c --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0200-automationcompositiondefinition.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.automationcompositiondefinition (compositionId VARCHAR(255) NOT NULL, name VARCHAR(255) NULL, restarting BIT NULL, serviceTemplate MEDIUMTEXT NULL, state TINYINT DEFAULT NULL NULL, stateChangeResult TINYINT DEFAULT NULL NULL, version VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITIONDEFINITION PRIMARY KEY (compositionId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql new file mode 100644 index 00000000..7bc18536 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0300-automationcompositionelement.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.automationcompositionelement (elementId VARCHAR(255) NOT NULL, definition_name VARCHAR(255) NULL, definition_version VARCHAR(255) NULL, deployState TINYINT DEFAULT NULL NULL, `description` VARCHAR(255) NULL, instanceId VARCHAR(255) NULL, lockState TINYINT DEFAULT NULL NULL, message VARCHAR(255) NULL, operationalState VARCHAR(255) NULL, outProperties MEDIUMTEXT NULL, participantId VARCHAR(255) NULL, properties MEDIUMTEXT NULL, restarting BIT NULL, useState VARCHAR(255) NULL, CONSTRAINT PK_AUTOMATIONCOMPOSITIONELEMENT PRIMARY KEY (elementId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql new file mode 100644 index 00000000..3ca27afc --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0400-nodetemplatestate.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.nodetemplatestate (nodeTemplateStateId VARCHAR(255) NOT NULL, compositionId VARCHAR(255) NULL, message VARCHAR(255) NULL, nodeTemplate_name VARCHAR(255) NULL, nodeTemplate_version VARCHAR(255) NULL, outProperties MEDIUMTEXT NULL, participantId VARCHAR(255) NULL, restarting BIT NULL, state TINYINT DEFAULT NULL NULL, CONSTRAINT PK_NODETEMPLATESTATE PRIMARY KEY (nodeTemplateStateId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql new file mode 100644 index 00000000..0f5a673b --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0500-participant.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.participant (participantId VARCHAR(255) NOT NULL, `description` VARCHAR(255) NULL, participantState TINYINT DEFAULT NULL NULL, CONSTRAINT PK_PARTICIPANT PRIMARY KEY (participantId));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql new file mode 100644 index 00000000..cf0f4c23 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0600-participantsupportedelements.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE TABLE clampacm.participantsupportedacelements (id VARCHAR(255) NOT NULL, participantId VARCHAR(255) NULL, typeName VARCHAR(255) NULL, typeVersion VARCHAR(255) NULL, CONSTRAINT PK_PARTICIPANTSUPPORTEDACELEMENTS PRIMARY KEY (id));
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql new file mode 100644 index 00000000..e5785f9f --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0700-ac_compositionId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX ac_compositionId ON clampacm.automationcomposition(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql new file mode 100644 index 00000000..4c2c2bc2 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0800-ac_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX ac_element_fk ON clampacm.automationcompositionelement(instanceId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql new file mode 100644 index 00000000..c67fdd62 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/0900-dt_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX dt_element_fk ON clampacm.nodetemplatestate(compositionId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql new file mode 100644 index 00000000..2ecba6f1 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1000-supported_element_fk_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +CREATE INDEX supported_element_fk ON clampacm.participantsupportedacelements(participantId);
\ No newline at end of file diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql new file mode 100644 index 00000000..6315271b --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1100-automationcompositionelement_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql new file mode 100644 index 00000000..8581deb1 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1200-nodetemplate_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql new file mode 100644 index 00000000..15f284a0 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/upgrade/1300-participantsupportedelements_fk.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2024 Nordix Foundation + * ================================================================================ + * 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========================================================= + */ + +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 diff --git a/policy-db-migrator/src/main/docker/db-migrator b/policy-db-migrator/src/main/docker/db-migrator index 3a4ccfa0..2261a394 100755 --- a/policy-db-migrator/src/main/docker/db-migrator +++ b/policy-db-migrator/src/main/docker/db-migrator @@ -4,7 +4,7 @@ # ONAP # ================================================================================ # Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright (C) 2021-2022 Nordix Foundation. +# Modifications Copyright (C) 2021-2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,11 +37,11 @@ # The nature of the migration directories is dynamic. # A number of environment variables needs to be initialized # prior to running db-migrator. -# These vaiables specifiy the connection details for the database +# These variables specify the connection details for the database # to be upgraded/downgraded. # # The repository of upgrade/downgrade scripts is located in the -# /home/policy/sql directory. +# /home/${SQL_DB}/sql directory. # Two additional scripts have been provided to prepare the directories/files # needed to perform the upgrade/downgrade. # diff --git a/policy-db-migrator/src/main/docker/db-migrator-pg b/policy-db-migrator/src/main/docker/db-migrator-pg index 607a86fa..49ed2e61 100755 --- a/policy-db-migrator/src/main/docker/db-migrator-pg +++ b/policy-db-migrator/src/main/docker/db-migrator-pg @@ -4,6 +4,7 @@ # ONAP # ================================================================================ # Copyright (C) 2022 Nordix Foundation. +# Modification Copyright 2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,11 +37,11 @@ # The nature of the migration directories is dynamic. # A number of environment variables needs to be initialized # prior to running db-migrator. -# These vaiables specifiy the connection details for the database +# These variables specify the connection details for the database # to be upgraded/downgraded. # # The repository of upgrade/downgrade scripts is located in the -# /home/policy/sql directory. +# /home/${SQL_DB}/sql directory. # Two additional scripts have been provided to prepare the directories/files # needed to perform the upgrade/downgrade. # diff --git a/policy-db-migrator/src/main/docker/prepare_downgrade.sh b/policy-db-migrator/src/main/docker/prepare_downgrade.sh index a7fdbbb3..d1d6533b 100755 --- a/policy-db-migrator/src/main/docker/prepare_downgrade.sh +++ b/policy-db-migrator/src/main/docker/prepare_downgrade.sh @@ -1,6 +1,7 @@ #!/bin/sh # ============LICENSE_START======================================================= # Copyright (C) 2021-2022 Nordix Foundation. +# Modification Copyright 2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +34,7 @@ mkdir -p $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/ # Remove any files from previous operations rm -rf $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/* 2>/dev/null # Copy files to downgrade directories -cd /home/policy/${SCRIPT_DIRECTORY} && find . -type f -not -path '*/upgrade/*' -not -path '*/upgrade' -print0 \ +cd /home/${SCHEMA}/${SCRIPT_DIRECTORY} && find . -type f -not -path '*/upgrade/*' -not -path '*/upgrade' -print0 \ | cpio --null -pud $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/ releases=$(find $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/*/downgrade -type d | sort -u | rev | cut -f2 -d/ | rev) diff --git a/policy-db-migrator/src/main/docker/prepare_upgrade.sh b/policy-db-migrator/src/main/docker/prepare_upgrade.sh index b5de226d..6cbc02cc 100755 --- a/policy-db-migrator/src/main/docker/prepare_upgrade.sh +++ b/policy-db-migrator/src/main/docker/prepare_upgrade.sh @@ -1,6 +1,7 @@ #!/bin/sh # ============LICENSE_START======================================================= # Copyright (C) 2021-2022 Nordix Foundation. +# Modification Copyright 2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +34,7 @@ mkdir -p $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/ # Remove any files from previous operations rm -rf $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/* 2>/dev/null # Copy files to upgrade directories -cd /home/policy/${SCRIPT_DIRECTORY} && find . -type f -not -path '*/downgrade/*' -not -path '*/downgrade' -print0 \ +cd /home/${SCHEMA}/${SCRIPT_DIRECTORY} && find . -type f -not -path '*/downgrade/*' -not -path '*/downgrade' -print0 \ | cpio --null -pud $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/ releases=$(find $POLICY_HOME/etc/db/migration/${SCHEMA}/${SCRIPT_DIRECTORY}/*/upgrade -type d | sort -u | rev | cut -f2 -d/ | rev) diff --git a/policy-db-migrator/src/main/docker/suse.Dockerfile b/policy-db-migrator/src/main/docker/suse.Dockerfile index bce31340..033c8a83 100644 --- a/policy-db-migrator/src/main/docker/suse.Dockerfile +++ b/policy-db-migrator/src/main/docker/suse.Dockerfile @@ -2,6 +2,7 @@ # Dockerfile # ============LICENSE_START======================================================= # Copyright (C) 2022 Nordix Foundation. +# Modification Copyright 2022-2024 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,8 +49,10 @@ COPY --chown=policy:policy ./db-migrator $POLICY_BIN/ COPY --chown=policy:policy ./db-migrator-pg $POLICY_BIN/ COPY --chown=policy:policy ./prepare_upgrade.sh $POLICY_BIN/ COPY --chown=policy:policy ./prepare_downgrade.sh $POLICY_BIN/ -COPY --chown=policy:policy ./config/policyadmin/sql /home/policy/sql -COPY --chown=policy:policy ./config/policyadmin/postgres /home/policy/postgres +COPY --chown=policy:policy ./config/policyadmin/sql /home/policyadmin/sql +COPY --chown=policy:policy ./config/policyadmin/postgres /home/policyadmin/postgres +COPY --chown=policy:policy ./config/clampacm/sql /home/clampacm/sql +COPY --chown=policy:policy ./config/clampacm/postgres /home/clampacm/postgres WORKDIR $POLICY_BIN USER policy:policy |