summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csit/distribution/tests/distribution-test.robot18
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0100-jpapdpgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0110-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0120-jpapdpsubgroup_policies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0130-jpapdpsubgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0210-jpatoscadatatype_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0220-jpatoscadatatype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0230-jpatoscadatatype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0250-jpatoscanodetemplate_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0260-jpatoscanodetype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0270-jpatoscanodetype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0280-jpatoscapolicy_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0290-jpatoscapolicy_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0300-jpatoscapolicy_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0310-jpatoscapolicytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0320-jpatoscapolicytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0330-jpatoscapolicytype_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0340-jpatoscapolicytype_triggers.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0350-jpatoscaproperty_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0360-jpatoscaproperty_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0390-jpatoscarequirement_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0400-jpatoscarequirement_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0410-jpatoscarequirement_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0450-pdpgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0460-pdppolicystatus.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0470-pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0480-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0490-pdpsubgroup_pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0500-pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0510-toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0520-toscacapabilityassignments.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0540-toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0550-toscacapabilitytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0570-toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0580-toscadatatypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0590-toscadatatypes_toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0600-toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0610-toscanodetemplates.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0630-toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0640-toscanodetypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0650-toscanodetypes_toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0660-toscaparameter.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0670-toscapolicies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0680-toscapolicies_toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0690-toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0700-toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0710-toscapolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0730-toscaproperty.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0740-toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0750-toscarelationshiptypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0770-toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0780-toscarequirements.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0790-toscarequirements_toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0800-toscaservicetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0810-toscatopologytemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0820-toscatrigger.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0100-pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0110-idx_tsidx1.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0120-pk_pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0130-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0140-pk_pdpstatistics.sql22
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0150-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0160-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0170-jpapdpstatistics_enginestats.sql22
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0180-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0190-jpapolicyaudit.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0210-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0220-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0100-pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0110-idx_tsidx1.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0120-pk_pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0130-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0140-pk_pdpstatistics.sql22
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0150-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0160-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0170-jpapdpstatistics_enginestats.sql22
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0180-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0190-jpapolicyaudit.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0210-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0220-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql22
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql22
135 files changed, 2709 insertions, 1 deletions
diff --git a/csit/distribution/tests/distribution-test.robot b/csit/distribution/tests/distribution-test.robot
index 8bf4b84d..c283f668 100644
--- a/csit/distribution/tests/distribution-test.robot
+++ b/csit/distribution/tests/distribution-test.robot
@@ -23,11 +23,27 @@ Metrics
[Documentation] Verify policy-distribution is exporting prometheus metrics
${hcauth}= HealthCheckAuth
${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_IP} /metrics 200 null ${hcauth}
- Should Contain ${resp.text} jvm_threads_current
+ Should Contain ${resp.text} total_distribution_received_count_total 0.0
+ Should Contain ${resp.text} distribution_success_count_total 0.0
+ Should Contain ${resp.text} distribution_failure_count_total 0.0
+ Should Contain ${resp.text} total_download_received_count_total 0.0
+ Should Contain ${resp.text} download_success_count_total 0.0
+ Should Contain ${resp.text} download_failure_count_total 0.0
InvokeDistributionAndRunEventOnEngine
Wait Until Keyword Succeeds 5 min 30 sec InvokeDistributionUsingFile And RunEventOnApexEngine
+MetricsAfterExecution
+ [Documentation] Verify policy-distribution is exporting prometheus metrics after execution
+ ${hcauth}= HealthCheckAuth
+ ${resp}= PerformGetRequest ${POLICY_DISTRIBUTION_IP} /metrics 200 null ${hcauth}
+ Should Contain ${resp.text} total_distribution_received_count_total 1.0
+ Should Contain ${resp.text} distribution_success_count_total 1.0
+ Should Contain ${resp.text} distribution_failure_count_total 0.0
+ Should Contain ${resp.text} total_download_received_count_total 1.0
+ Should Contain ${resp.text} download_success_count_total 1.0
+ Should Contain ${resp.text} download_failure_count_total 0.0
+
*** Keywords ***
InvokeDistributionUsingFile And RunEventOnApexEngine
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0100-jpapdpgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0100-jpapdpgroup_properties.sql
new file mode 100644
index 00000000..0dbc46b0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0100-jpapdpgroup_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapdpgroup_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES VARCHAR(255) NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0110-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..0f0382ea
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0110-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapdpstatistics_enginestats (AVERAGEEXECUTIONTIME DOUBLE PRECISION DEFAULT NULL NULL, ENGINEID VARCHAR(255) NULL, ENGINETIMESTAMP BIGINT DEFAULT NULL NULL, ENGINEWORKERSTATE INT DEFAULT NULL NULL, EVENTCOUNT BIGINT DEFAULT NULL NULL, LASTENTERTIME BIGINT DEFAULT NULL NULL, LASTEXECUTIONTIME BIGINT DEFAULT NULL NULL, LASTSTART BIGINT DEFAULT NULL NULL, UPTIME BIGINT DEFAULT NULL NULL, timeStamp TIMESTAMP DEFAULT NULL NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0120-jpapdpsubgroup_policies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0120-jpapdpsubgroup_policies.sql
new file mode 100644
index 00000000..6ceb2390
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0120-jpapdpsubgroup_policies.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapdpsubgroup_policies (name VARCHAR(120) NULL, version VARCHAR(20) NULL, parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0130-jpapdpsubgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0130-jpapdpsubgroup_properties.sql
new file mode 100644
index 00000000..be7c4feb
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0130-jpapdpsubgroup_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapdpsubgroup_properties (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, PROPERTIES VARCHAR(255) NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql
new file mode 100644
index 00000000..c645acd5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapdpsubgroup_supportedpolicytypes (name VARCHAR(120) NULL, version VARCHAR(20) NULL, parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql
new file mode 100644
index 00000000..18c2e2f7
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilityassignment_attributes (name VARCHAR(120) NULL, version VARCHAR(20) NULL, ATTRIBUTES TEXT NULL, ATTRIBUTES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql
new file mode 100644
index 00000000..60ac9696
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilityassignment_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql
new file mode 100644
index 00000000..479b0a65
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilityassignment_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql
new file mode 100644
index 00000000..a0bfae52
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilityassignment_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES TEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql
new file mode 100644
index 00000000..eea09fee
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilitytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql
new file mode 100644
index 00000000..4720a4bf
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscacapabilitytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES BYTEA DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0210-jpatoscadatatype_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0210-jpatoscadatatype_constraints.sql
new file mode 100644
index 00000000..2b11a0d3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0210-jpatoscadatatype_constraints.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscadatatype_constraints (name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINTS VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0220-jpatoscadatatype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0220-jpatoscadatatype_metadata.sql
new file mode 100644
index 00000000..0e1b5363
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0220-jpatoscadatatype_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscadatatype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0230-jpatoscadatatype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0230-jpatoscadatatype_properties.sql
new file mode 100644
index 00000000..2268779e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0230-jpatoscadatatype_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscadatatype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES BYTEA DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql
new file mode 100644
index 00000000..01b348cc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscanodetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0250-jpatoscanodetemplate_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0250-jpatoscanodetemplate_properties.sql
new file mode 100644
index 00000000..ee118cde
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0250-jpatoscanodetemplate_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscanodetemplate_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES TEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0260-jpatoscanodetype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0260-jpatoscanodetype_metadata.sql
new file mode 100644
index 00000000..ae8b5925
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0260-jpatoscanodetype_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscanodetype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0270-jpatoscanodetype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0270-jpatoscanodetype_properties.sql
new file mode 100644
index 00000000..a48e3aa3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0270-jpatoscanodetype_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscanodetype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES BYTEA DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0280-jpatoscapolicy_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0280-jpatoscapolicy_metadata.sql
new file mode 100644
index 00000000..f62dc93f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0280-jpatoscapolicy_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicy_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0290-jpatoscapolicy_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0290-jpatoscapolicy_properties.sql
new file mode 100644
index 00000000..482297a2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0290-jpatoscapolicy_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicy_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES TEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0300-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0300-jpatoscapolicy_targets.sql
new file mode 100644
index 00000000..89d27525
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0300-jpatoscapolicy_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicy_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0310-jpatoscapolicytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0310-jpatoscapolicytype_metadata.sql
new file mode 100644
index 00000000..03ef5938
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0310-jpatoscapolicytype_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0320-jpatoscapolicytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0320-jpatoscapolicytype_properties.sql
new file mode 100644
index 00000000..32fbde5c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0320-jpatoscapolicytype_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES BYTEA DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0330-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0330-jpatoscapolicytype_targets.sql
new file mode 100644
index 00000000..e01cbc18
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0330-jpatoscapolicytype_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicytype_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0340-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0340-jpatoscapolicytype_triggers.sql
new file mode 100644
index 00000000..fb738c03
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0340-jpatoscapolicytype_triggers.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscapolicytype_triggers (name VARCHAR(120) NULL, version VARCHAR(20) NULL, TRIGGERS VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0350-jpatoscaproperty_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0350-jpatoscaproperty_constraints.sql
new file mode 100644
index 00000000..6fbf4df0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0350-jpatoscaproperty_constraints.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0360-jpatoscaproperty_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0360-jpatoscaproperty_metadata.sql
new file mode 100644
index 00000000..a72a16a1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0360-jpatoscaproperty_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql
new file mode 100644
index 00000000..d170ea28
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscarelationshiptype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql
new file mode 100644
index 00000000..e4ac7384
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscarelationshiptype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES BYTEA DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0390-jpatoscarequirement_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0390-jpatoscarequirement_metadata.sql
new file mode 100644
index 00000000..611aecb0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0390-jpatoscarequirement_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscarequirement_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0400-jpatoscarequirement_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0400-jpatoscarequirement_occurrences.sql
new file mode 100644
index 00000000..945c4cd4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0400-jpatoscarequirement_occurrences.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscarequirement_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0410-jpatoscarequirement_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0410-jpatoscarequirement_properties.sql
new file mode 100644
index 00000000..a705a941
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0410-jpatoscarequirement_properties.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscarequirement_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES TEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql
new file mode 100644
index 00000000..ea13b6ac
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscaservicetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql
new file mode 100644
index 00000000..856265a6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpatoscatopologytemplate_inputs (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, INPUTS BYTEA DEFAULT NULL NULL, INPUTS_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql
new file mode 100644
index 00000000..102f68f1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdpgroup_pdpsubgroup (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPGROUP_PDPSUBGROUP PRIMARY KEY (name, version, parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0450-pdpgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0450-pdpgroup.sql
new file mode 100644
index 00000000..ac04634f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0450-pdpgroup.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdpgroup (DESCRIPTION VARCHAR(255) NULL, PDPGROUPSTATE INT DEFAULT NULL NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_PDPGROUP PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0460-pdppolicystatus.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0460-pdppolicystatus.sql
new file mode 100644
index 00000000..d2a43b53
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0460-pdppolicystatus.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdppolicystatus (DEPLOY BIT DEFAULT 0::bit NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, STATE INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_PDPPOLICYSTATUS PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0470-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0470-pdp.sql
new file mode 100644
index 00000000..e6c885ed
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0470-pdp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdp (HEALTHY INT DEFAULT NULL NULL, MESSAGE VARCHAR(255) NULL, PDPSTATE INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDP PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0480-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0480-pdpstatistics.sql
new file mode 100644
index 00000000..80dc40fa
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0480-pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdpstatistics (PDPGROUPNAME VARCHAR(120) NULL, PDPSUBGROUPNAME VARCHAR(120) NULL, POLICYDEPLOYCOUNT BIGINT DEFAULT NULL NULL, POLICYDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, POLICYDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDFAILCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDSUCCESSCOUNT BIGINT DEFAULT NULL NULL, timeStamp TIMESTAMP NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0490-pdpsubgroup_pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0490-pdpsubgroup_pdp.sql
new file mode 100644
index 00000000..01c9bfa6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0490-pdpsubgroup_pdp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdpsubgroup_pdp (pdpParentKeyName VARCHAR(120) NOT NULL, pdpParentKeyVersion VARCHAR(15) NOT NULL, pdpParentLocalName VARCHAR(120) NOT NULL, pdpLocalName VARCHAR(120) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPSUBGROUP_PDP PRIMARY KEY (pdpParentKeyName, pdpParentKeyVersion, pdpParentLocalName, pdpLocalName, parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0500-pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0500-pdpsubgroup.sql
new file mode 100644
index 00000000..94779ff5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0500-pdpsubgroup.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS pdpsubgroup (CURRENTINSTANCECOUNT INT DEFAULT NULL NULL, DESIREDINSTANCECOUNT INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPSUBGROUP PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0510-toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0510-toscacapabilityassignment.sql
new file mode 100644
index 00000000..d7d91c2d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0510-toscacapabilityassignment.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilityassignment (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENT PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0520-toscacapabilityassignments.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0520-toscacapabilityassignments.sql
new file mode 100644
index 00000000..f4d83199
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0520-toscacapabilityassignments.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilityassignments (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENTS PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql
new file mode 100644
index 00000000..90f849af
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilityassignments_toscacapabilityassignment (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENTS_TOSCACAPABILITYASSIGNMENT PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0540-toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0540-toscacapabilitytype.sql
new file mode 100644
index 00000000..4e7d2b7e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0540-toscacapabilitytype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilitytype (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYTYPE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0550-toscacapabilitytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0550-toscacapabilitytypes.sql
new file mode 100644
index 00000000..886a1fcb
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0550-toscacapabilitytypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilitytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYTYPES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql
new file mode 100644
index 00000000..496c2679
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscacapabilitytypes_toscacapabilitytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCACAPABILITYTYPES_TOSCACAPABILITYTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0570-toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0570-toscadatatype.sql
new file mode 100644
index 00000000..507c076d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0570-toscadatatype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscadatatype (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCADATATYPE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0580-toscadatatypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0580-toscadatatypes.sql
new file mode 100644
index 00000000..26dcd4d0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0580-toscadatatypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscadatatypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCADATATYPES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0590-toscadatatypes_toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0590-toscadatatypes_toscadatatype.sql
new file mode 100644
index 00000000..c3461792
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0590-toscadatatypes_toscadatatype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscadatatypes_toscadatatype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCADATATYPES_TOSCADATATYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0600-toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0600-toscanodetemplate.sql
new file mode 100644
index 00000000..ddd720bd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0600-toscanodetemplate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetemplate (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, capabilitiesName VARCHAR(120) NULL, capabilitiesVersion VARCHAR(20) NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, CONSTRAINT PK_TOSCANODETEMPLATE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0610-toscanodetemplates.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0610-toscanodetemplates.sql
new file mode 100644
index 00000000..443ae7f6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0610-toscanodetemplates.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetemplates (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCANODETEMPLATES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql
new file mode 100644
index 00000000..e21d174c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetemplates_toscanodetemplate (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCANODETEMPLATES_TOSCANODETEMPLATE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0630-toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0630-toscanodetype.sql
new file mode 100644
index 00000000..350b377b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0630-toscanodetype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetype (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, CONSTRAINT PK_TOSCANODETYPE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0640-toscanodetypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0640-toscanodetypes.sql
new file mode 100644
index 00000000..35d7193a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0640-toscanodetypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCANODETYPES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0650-toscanodetypes_toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0650-toscanodetypes_toscanodetype.sql
new file mode 100644
index 00000000..3ab18505
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0650-toscanodetypes_toscanodetype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscanodetypes_toscanodetype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCANODETYPES_TOSCANODETYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0660-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0660-toscaparameter.sql
new file mode 100644
index 00000000..957573f0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0660-toscaparameter.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPARAMETER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0670-toscapolicies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0670-toscapolicies.sql
new file mode 100644
index 00000000..a6ff2eb8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0670-toscapolicies.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicies (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICIES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0680-toscapolicies_toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0680-toscapolicies_toscapolicy.sql
new file mode 100644
index 00000000..cdad489b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0680-toscapolicies_toscapolicy.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicies_toscapolicy (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPOLICIES_TOSCAPOLICY PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0690-toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0690-toscapolicy.sql
new file mode 100644
index 00000000..89d34081
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0690-toscapolicy.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicy (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCAPOLICY PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0700-toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0700-toscapolicytype.sql
new file mode 100644
index 00000000..efafcb04
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0700-toscapolicytype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicytype (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICYTYPE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0710-toscapolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0710-toscapolicytypes.sql
new file mode 100644
index 00000000..7831adc2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0710-toscapolicytypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICYTYPES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql
new file mode 100644
index 00000000..01f09ebc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscapolicytypes_toscapolicytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPOLICYTYPES_TOSCAPOLICYTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0730-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0730-toscaproperty.sql
new file mode 100644
index 00000000..6b77adf9
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0730-toscaproperty.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL, ENTRYSCHEMA BYTEA DEFAULT NULL NULL, REQUIRED BIT DEFAULT 0::bit NULL, STATUS INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPROPERTY PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0740-toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0740-toscarelationshiptype.sql
new file mode 100644
index 00000000..b2cf5641
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0740-toscarelationshiptype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarelationshiptype (DESCRIPTION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0750-toscarelationshiptypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0750-toscarelationshiptypes.sql
new file mode 100644
index 00000000..b297680d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0750-toscarelationshiptypes.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarelationshiptypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPES PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql
new file mode 100644
index 00000000..9882644c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarelationshiptypes_toscarelationshiptype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPES_TOSCARELATIONSHIPTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0770-toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0770-toscarequirement.sql
new file mode 100644
index 00000000..a225e0a9
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0770-toscarequirement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarequirement (CAPABILITY VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL, NODE VARCHAR(255) NULL, RELATIONSHIP VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCAREQUIREMENT PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0780-toscarequirements.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0780-toscarequirements.sql
new file mode 100644
index 00000000..2e9aaa9c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0780-toscarequirements.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarequirements (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAREQUIREMENTS PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0790-toscarequirements_toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0790-toscarequirements_toscarequirement.sql
new file mode 100644
index 00000000..25fe80df
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0790-toscarequirements_toscarequirement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscarequirements_toscarequirement (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAREQUIREMENTS_TOSCAREQUIREMENT PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0800-toscaservicetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0800-toscaservicetemplate.sql
new file mode 100644
index 00000000..26fce54f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0800-toscaservicetemplate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscaservicetemplate (DESCRIPTION VARCHAR(255) NULL, TOSCADEFINITIONSVERSION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, capabilityTypesVersion VARCHAR(20) NULL, capabilityTypesName VARCHAR(120) NULL, dataTypesName VARCHAR(120) NULL, dataTypesVersion VARCHAR(20) NULL, nodeTypesVersion VARCHAR(20) NULL, nodeTypesName VARCHAR(120) NULL, policyTypesName VARCHAR(120) NULL, policyTypesVersion VARCHAR(20) NULL, relationshipTypesVersion VARCHAR(20) NULL, relationshipTypesName VARCHAR(120) NULL, topologyTemplateLocalName VARCHAR(120) NULL, topologyTemplateParentKeyName VARCHAR(120) NULL, topologyTemplateParentKeyVersion VARCHAR(15) NULL, topologyTemplateParentLocalName VARCHAR(120) NULL, CONSTRAINT PK_TOSCASERVICETEMPLATE PRIMARY KEY (name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0810-toscatopologytemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0810-toscatopologytemplate.sql
new file mode 100644
index 00000000..dd97db0b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0810-toscatopologytemplate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscatopologytemplate (description VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, nodeTemplatessVersion VARCHAR(20) NULL, nodeTemplatesName VARCHAR(120) NULL, policyVersion VARCHAR(20) NULL, policyName VARCHAR(120) NULL, CONSTRAINT PK_TOSCATOPOLOGYTEMPLATE PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0820-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0820-toscatrigger.sql
new file mode 100644
index 00000000..0270f079
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0820-toscatrigger.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition BYTEA DEFAULT NULL NULL, toscaConstraint BYTEA DEFAULT NULL NULL, DESCRIPTION VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, PERIOD BYTEA DEFAULT NULL NULL, SCHEDULE BYTEA DEFAULT NULL NULL, TARGETFILTER BYTEA DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_TOSCATRIGGER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..8d798b69
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate(capabilitiesName, capabilitiesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..380fb110
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaNodeTemplate_requirementsName ON toscanodetemplate(requirementsName, requirementsVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..1ee32de8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 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 FK_ToscaNodeType_requirementsName ON toscanodetype(requirementsName, requirementsVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..97359416
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate(capabilityTypesName, capabilityTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..9fbe5a65
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate(dataTypesName, dataTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..c7a308bc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate(nodeTypesName, nodeTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..a83d679b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate(policyTypesName, policyTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..b13649ec
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate(relationshipTypesName, relationshipTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..64fe698c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate(nodeTemplatesName, nodeTemplatessVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..eda269e1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 FK_ToscaTopologyTemplate_policyName ON toscatopologytemplate(policyName, policyVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql
new file mode 100644
index 00000000..0d37625f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0940-PdpPolicyStatus_PdpGroup.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 PdpPolicyStatus_PdpGroup ON pdppolicystatus(PDPGROUP);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..bcbc4edb
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate(topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..23c164fd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0960-FK_ToscaNodeTemplate_capabilitiesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES toscacapabilityassignments (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..15d40198
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0970-FK_ToscaNodeTemplate_requirementsName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..0fb2b677
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0980-FK_ToscaNodeType_requirementsName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscanodetype ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..e6e2b1b3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/0990-FK_ToscaServiceTemplate_capabilityTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_capabilityTypesName FOREIGN KEY (capabilityTypesName, capabilityTypesVersion) REFERENCES toscacapabilitytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..be86fd68
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1000-FK_ToscaServiceTemplate_dataTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES toscadatatypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..fb31ff4f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1010-FK_ToscaServiceTemplate_nodeTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_nodeTypesName FOREIGN KEY (nodeTypesName, nodeTypesVersion) REFERENCES toscanodetypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..da0b56b2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1020-FK_ToscaServiceTemplate_policyTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_policyTypesName FOREIGN KEY (policyTypesName, policyTypesVersion) REFERENCES toscapolicytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..4ee1e90f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1030-FK_ToscaServiceTemplate_relationshipTypesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_relationshipTypesName FOREIGN KEY (relationshipTypesName, relationshipTypesVersion) REFERENCES toscarelationshiptypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..f049e071
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_nodeTemplatesName FOREIGN KEY (nodeTemplatesName, nodeTemplatessVersion) REFERENCES toscanodetemplates (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..34a26541
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1050-FK_ToscaTopologyTemplate_policyName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES toscapolicies (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..06621658
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 toscaservicetemplate ADD CONSTRAINT TscaServiceTemplatetopologyTemplateParentLocalName FOREIGN KEY (topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName) REFERENCES toscatopologytemplate (parentLocalName, localName, parentKeyVersion, parentKeyName) ON UPDATE RESTRICT ON DELETE RESTRICT;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0100-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0100-pdp.sql
new file mode 100644
index 00000000..fbc9c47d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0100-pdp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdp DROP COLUMN LASTUPDATE;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0110-idx_tsidx1.sql
new file mode 100644
index 00000000..4df00a1b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0110-idx_tsidx1.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IDX_TSIDX1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0120-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0120-pk_pdpstatistics.sql
new file mode 100644
index 00000000..65425348
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0120-pk_pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0130-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0130-pdpstatistics.sql
new file mode 100644
index 00000000..a8d021ff
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0130-pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics DROP COLUMN POLICYUNDEPLOYCOUNT, DROP COLUMN POLICYUNDEPLOYFAILCOUNT, DROP COLUMN POLICYUNDEPLOYSUCCESSCOUNT, DROP COLUMN ID;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0140-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0140-pk_pdpstatistics.sql
new file mode 100644
index 00000000..6b87eef3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0140-pk_pdpstatistics.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics DROP CONSTRAINT PRIMARY KEY;
+
+UPDATE pdpstatistics set ID = 0;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0150-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0150-pdpstatistics.sql
new file mode 100644
index 00000000..17c4e6a8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0150-pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics ALTER COLUMN timeStamp TYPE TIMESTAMP(6);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0160-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0160-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..b2bdb432
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0160-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 jpapdpstatistics_enginestats DROP COLUMN ID;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0170-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0170-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..8a33f691
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0170-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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=========================================================
+ */
+UPDATE jpapdpstatistics_enginestats AS a
+SET timeStamp=b.timeStamp
+FROM pdpstatistics AS b
+WHERE a.name=b.name AND a.version=b.version AND a.id=b.id;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0180-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0180-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..114467bf
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0180-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 jpapdpstatistics_enginestats ADD COLUMN timeStamp TIMESTAMP(6) DEFAULT NULL NULL;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0190-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0190-jpapolicyaudit.sql
new file mode 100644
index 00000000..3a6176f4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0190-jpapolicyaudit.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF EXISTS jpapolicyaudit;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql
new file mode 100644
index 00000000..284ca0c1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0200-JpaPolicyAuditIndex_timestamp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 JpaPolicyAuditIndex_timestamp;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0210-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0210-sequence.sql
new file mode 100644
index 00000000..43043485
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0210-sequence.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF EXISTS sequence;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0220-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0220-sequence.sql
new file mode 100644
index 00000000..f2724415
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/downgrade/0220-sequence.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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=========================================================
+ */
+
+DELETE from sequence;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0100-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0100-pdp.sql
new file mode 100644
index 00000000..7c923d3e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0100-pdp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdp ADD COLUMN LASTUPDATE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0110-idx_tsidx1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0110-idx_tsidx1.sql
new file mode 100644
index 00000000..0becab72
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0110-idx_tsidx1.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0120-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0120-pk_pdpstatistics.sql
new file mode 100644
index 00000000..c6d8d8ed
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0120-pk_pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics DROP CONSTRAINT pk_pdpstatistics;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0130-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0130-pdpstatistics.sql
new file mode 100644
index 00000000..611a7b9b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0130-pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics ADD COLUMN POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN ID BIGINT NOT NULL;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0140-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0140-pk_pdpstatistics.sql
new file mode 100644
index 00000000..86fe9779
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0140-pk_pdpstatistics.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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=========================================================
+ */
+
+UPDATE pdpstatistics as p SET id=t.row_num FROM (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t WHERE p.name=t.name AND p.version=t.version AND p.timeStamp=t.timeStamp;
+
+ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0150-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0150-pdpstatistics.sql
new file mode 100644
index 00000000..5cf66cf2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0150-pdpstatistics.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 pdpstatistics ALTER COLUMN timeStamp TIMESTAMP(6);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0160-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0160-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..9ca423fd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0160-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 jpapdpstatistics_enginestats ADD COLUMN ID BIGINT DEFAULT NULL NULL;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0170-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0170-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..cbd5aa30
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0170-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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=========================================================
+ */
+UPDATE jpapdpstatistics_enginestats AS a
+SET id = b.id
+FROM pdpstatistics AS b
+WHERE a.name = b.name AND a.version = b.version AND a.timeStamp = b.timeStamp;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0180-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0180-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..f1041131
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0180-jpapdpstatistics_enginestats.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 jpapdpstatistics_enginestats DROP COLUMN timeStamp;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0190-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0190-jpapolicyaudit.sql
new file mode 100644
index 00000000..319ea004
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0190-jpapolicyaudit.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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 IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP TIMESTAMP DEFAULT NULL NULL, "USER" VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql
new file mode 100644
index 00000000..d789d118
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0200-JpaPolicyAuditIndex_timestamp.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 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 JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0210-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0210-sequence.sql
new file mode 100644
index 00000000..64d6f01b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0210-sequence.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 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 IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL NULL, CONSTRAINT PK_SEQUENCE PRIMARY KEY (SEQ_NAME));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0220-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0220-sequence.sql
new file mode 100644
index 00000000..9c02d144
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/postgres/0900/upgrade/0220-sequence.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 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=========================================================
+ */
+
+INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT COALESCE(max(id),0) FROM pdpstatistics));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql
new file mode 100644
index 00000000..ec1da675
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicy_targets DROP COLUMN toscaPolicyName, DROP COLUMN toscaPolicyVersion;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql
new file mode 100644
index 00000000..b08a2ab4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_targets DROP COLUMN toscaPolicyTypeName, DROP COLUMN toscaPolicyTypeVersion;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql
new file mode 100644
index 00000000..d701bd45
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition LONGBLOB DEFAULT NULL NULL, toscaConstraint LONGBLOB DEFAULT NULL NULL, `DESCRIPTION` VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, `PERIOD` LONGBLOB DEFAULT NULL NULL, SCHEDULE LONGBLOB DEFAULT NULL NULL, TARGETFILTER LONGBLOB DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_TOSCATRIGGER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql
new file mode 100644
index 00000000..35864300
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers VARCHAR(255);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql
new file mode 100644
index 00000000..51db2ab9
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPARAMETER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql
new file mode 100644
index 00000000..eef07f93
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL);
+CREATE TABLE IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
+CREATE TABLE IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, ENTRYSCHEMA LONGBLOB DEFAULT NULL NULL, REQUIRED BIT DEFAULT 0 NULL, STATUS INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPROPERTY PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql
new file mode 100644
index 00000000..aab9f360
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicy_targets ADD COLUMN toscaPolicyName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICY_TARGETS PRIMARY KEY (toscaPolicyName, toscaPolicyVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql
new file mode 100644
index 00000000..e4a5d750
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_targets ADD COLUMN toscaPolicyTypeName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyTypeVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICYTYPE_TARGETS PRIMARY KEY (toscaPolicyTypeName, toscaPolicyTypeVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql
new file mode 100644
index 00000000..2d5d6e87
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+DROP TABLE IF EXISTS toscatrigger;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql
new file mode 100644
index 00000000..b0907e16
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers LONGBLOB;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql
new file mode 100644
index 00000000..82ec7a21
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+DROP TABLE IF EXISTS toscaparameter;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql
new file mode 100644
index 00000000..f270ae43
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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=========================================================
+ */
+
+DROP TABLE IF EXISTS jpatoscaproperty_constraints;
+DROP TABLE IF EXISTS jpatoscaproperty_metadata;
+DROP TABLE IF EXISTS toscaproperty;