summaryrefslogtreecommitdiffstats
path: root/policy-db-migrator/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'policy-db-migrator/src/main')
-rw-r--r--policy-db-migrator/src/main/docker/Dockerfile43
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeType_requirementsName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaTopologyTemplate_policyName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-IDX_TSIDX1.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-PdpPolicyStatus_PdpGroup.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeType_requirementsName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaTopologyTemplate_policyName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-IDX_TSIDX1.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-PdpPolicyStatus_PdpGroup.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-jpapolicyaudit.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-JpaPolicyAuditIndex_timestamp.sql24
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-jpapolicyaudit.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-sequence.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-JpaPolicyAuditIndex_timestamp.sql20
-rw-r--r--policy-db-migrator/src/main/docker/db-migrator632
-rw-r--r--policy-db-migrator/src/main/docker/env.sh57
-rw-r--r--policy-db-migrator/src/main/docker/prepare_downgrade.sh44
-rw-r--r--policy-db-migrator/src/main/docker/prepare_upgrade.sh44
205 files changed, 4876 insertions, 0 deletions
diff --git a/policy-db-migrator/src/main/docker/Dockerfile b/policy-db-migrator/src/main/docker/Dockerfile
new file mode 100644
index 00000000..581c8299
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/Dockerfile
@@ -0,0 +1,43 @@
+#-------------------------------------------------------------------------------
+# Dockerfile
+# ============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=========================================================
+#-------------------------------------------------------------------------------
+FROM onap/policy-jdk-alpine:2.2.1
+
+LABEL maintainer="Policy Team"
+
+ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
+ENV POLICY_ETC /opt/app/policy/etc
+ENV POLICY_PROFILE /opt/app/policy/etc/profile.d
+ENV POLICY_BIN /opt/app/policy/bin
+
+RUN apk update && \
+ apk add --no-cache mariadb-client \
+ net-tools netcat-openbsd sudo less vim && \
+ mkdir -p $POLICY_PROFILE $POLICY_BIN && \
+ chown -R policy:policy $POLICY_ETC $POLICY_BIN
+
+COPY --chown=policy:policy ./env.sh $POLICY_PROFILE/
+COPY --chown=policy:policy ./db-migrator $POLICY_BIN/
+COPY --chown=policy:policy ./prepare_upgrade.sh $POLICY_BIN/
+COPY --chown=policy:policy ./prepare_downgrade.sh $POLICY_BIN/
+COPY --chown=policy:policy ./config/policyadmin/sql /home/policy/sql
+
+WORKDIR $POLICY_BIN
+USER policy:policy
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.sql
new file mode 100644
index 00000000..3210b9cd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0100-jpapdpgroup_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapdpgroup_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..06c747cf
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0110-jpapdpstatistics_enginestats.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapdpstatistics_enginestats`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.sql
new file mode 100644
index 00000000..03e5e859
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0120-jpapdpsubgroup_policies.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapdpsubgroup_policies`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.sql
new file mode 100644
index 00000000..7821a133
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0130-jpapdpsubgroup_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapdpsubgroup_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql
new file mode 100644
index 00000000..381bf55a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0140-jpapdpsubgroup_supportedpolicytypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapdpsubgroup_supportedpolicytypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.sql
new file mode 100644
index 00000000..dcc5c809
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0150-jpatoscacapabilityassignment_attributes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilityassignment_attributes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.sql
new file mode 100644
index 00000000..c64fb42d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0160-jpatoscacapabilityassignment_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilityassignment_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.sql
new file mode 100644
index 00000000..60abbd66
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0170-jpatoscacapabilityassignment_occurrences.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilityassignment_occurrences`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.sql
new file mode 100644
index 00000000..e9564712
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0180-jpatoscacapabilityassignment_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilityassignment_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.sql
new file mode 100644
index 00000000..9d271080
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0190-jpatoscacapabilitytype_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilitytype_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.sql
new file mode 100644
index 00000000..288ba51b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0200-jpatoscacapabilitytype_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscacapabilitytype_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.sql
new file mode 100644
index 00000000..55f87939
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0210-jpatoscadatatype_constraints.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscadatatype_constraints`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.sql
new file mode 100644
index 00000000..d20dbcdd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0220-jpatoscadatatype_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscadatatype_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.sql
new file mode 100644
index 00000000..68c9f2ee
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0230-jpatoscadatatype_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscadatatype_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.sql
new file mode 100644
index 00000000..95f6796e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0240-jpatoscanodetemplate_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscanodetemplate_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.sql
new file mode 100644
index 00000000..ba2d5d87
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0250-jpatoscanodetemplate_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscanodetemplate_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.sql
new file mode 100644
index 00000000..706cbdce
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0260-jpatoscanodetype_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscanodetype_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.sql
new file mode 100644
index 00000000..8102719b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0270-jpatoscanodetype_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscanodetype_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.sql
new file mode 100644
index 00000000..7879a58c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0280-jpatoscapolicy_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicy_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.sql
new file mode 100644
index 00000000..ac7f116c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0290-jpatoscapolicy_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicy_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.sql
new file mode 100644
index 00000000..702def86
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0300-jpatoscapolicy_targets.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicy_targets`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.sql
new file mode 100644
index 00000000..cd7d7163
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0310-jpatoscapolicytype_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicytype_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.sql
new file mode 100644
index 00000000..4d4ec1dd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0320-jpatoscapolicytype_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicytype_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.sql
new file mode 100644
index 00000000..9e80de71
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0330-jpatoscapolicytype_targets.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicytype_targets`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.sql
new file mode 100644
index 00000000..d260c5b5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0340-jpatoscapolicytype_triggers.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscapolicytype_triggers`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.sql
new file mode 100644
index 00000000..5c369968
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0350-jpatoscaproperty_constraints.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscaproperty_constraints`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.sql
new file mode 100644
index 00000000..565a77a4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0360-jpatoscaproperty_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscaproperty_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.sql
new file mode 100644
index 00000000..b3e936c5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0370-jpatoscarelationshiptype_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscarelationshiptype_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.sql
new file mode 100644
index 00000000..f015d5fd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0380-jpatoscarelationshiptype_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscarelationshiptype_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.sql
new file mode 100644
index 00000000..de18e406
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0390-jpatoscarequirement_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscarequirement_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.sql
new file mode 100644
index 00000000..3941567f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0400-jpatoscarequirement_occurrences.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscarequirement_occurrences`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.sql
new file mode 100644
index 00000000..3fc645c6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0410-jpatoscarequirement_properties.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscarequirement_properties`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.sql
new file mode 100644
index 00000000..554b4097
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0420-jpatoscaservicetemplate_metadata.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscaservicetemplate_metadata`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.sql
new file mode 100644
index 00000000..134a9bb5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0430-jpatoscatopologytemplate_inputs.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpatoscatopologytemplate_inputs`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.sql
new file mode 100644
index 00000000..65a35d40
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0440-pdpgroup_pdpsubgroup.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdpgroup_pdpsubgroup`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.sql
new file mode 100644
index 00000000..9409b0eb
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0450-pdpgroup.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdpgroup`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.sql
new file mode 100644
index 00000000..44ad18c4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0460-pdppolicystatus.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdppolicystatus`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.sql
new file mode 100644
index 00000000..83024b7d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0470-pdp.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdp`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.sql
new file mode 100644
index 00000000..ba52071c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0480-pdpstatistics.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdpstatistics`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.sql
new file mode 100644
index 00000000..2812dc90
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0490-pdpsubgroup_pdp.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdpsubgroup_pdp`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.sql
new file mode 100644
index 00000000..8b30965a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0500-pdpsubgroup.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `pdpsubgroup`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.sql
new file mode 100644
index 00000000..47e55378
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0510-toscacapabilityassignment.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilityassignment`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.sql
new file mode 100644
index 00000000..b3c09cb7
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0520-toscacapabilityassignments.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilityassignments`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql
new file mode 100644
index 00000000..9081377f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0530-toscacapabilityassignments_toscacapabilityassignment.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilityassignments_toscacapabilityassignment`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.sql
new file mode 100644
index 00000000..e51f5a7c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0540-toscacapabilitytype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilitytype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.sql
new file mode 100644
index 00000000..6ca7e239
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0550-toscacapabilitytypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilitytypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql
new file mode 100644
index 00000000..27f2ad2e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0560-toscacapabilitytypes_toscacapabilitytype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscacapabilitytypes_toscacapabilitytype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.sql
new file mode 100644
index 00000000..71fcdedf
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0570-toscadatatype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscadatatype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.sql
new file mode 100644
index 00000000..1ca4e093
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0580-toscadatatypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscadatatypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.sql
new file mode 100644
index 00000000..d012cc18
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0590-toscadatatypes_toscadatatype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscadatatypes_toscadatatype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.sql
new file mode 100644
index 00000000..f02bd9a4
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0600-toscanodetemplate.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetemplate`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.sql
new file mode 100644
index 00000000..1d0c001b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0610-toscanodetemplates.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetemplates`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.sql
new file mode 100644
index 00000000..a1d561f1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0620-toscanodetemplates_toscanodetemplate.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetemplates_toscanodetemplate`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.sql
new file mode 100644
index 00000000..00e7fb0c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0630-toscanodetype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.sql
new file mode 100644
index 00000000..745ae524
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0640-toscanodetypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.sql
new file mode 100644
index 00000000..c57acbd0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0650-toscanodetypes_toscanodetype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscanodetypes_toscanodetype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.sql
new file mode 100644
index 00000000..fc09aa72
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0660-toscaparameter.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscaparameter`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.sql
new file mode 100644
index 00000000..e5838d8d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0670-toscapolicies.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicies`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.sql
new file mode 100644
index 00000000..badb1685
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0680-toscapolicies_toscapolicy.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicies_toscapolicy`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.sql
new file mode 100644
index 00000000..0dcf3913
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0690-toscapolicy.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicy`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.sql
new file mode 100644
index 00000000..a13b9015
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0700-toscapolicytype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicytype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.sql
new file mode 100644
index 00000000..9967dc60
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0710-toscapolicytypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicytypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.sql
new file mode 100644
index 00000000..b17c4658
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0720-toscapolicytypes_toscapolicytype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscapolicytypes_toscapolicytype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.sql
new file mode 100644
index 00000000..3673bb38
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0730-toscaproperty.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscaproperty`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.sql
new file mode 100644
index 00000000..cf2d4ee0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0740-toscarelationshiptype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarelationshiptype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.sql
new file mode 100644
index 00000000..9d91d513
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0750-toscarelationshiptypes.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarelationshiptypes`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql
new file mode 100644
index 00000000..7a1ed97a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0760-toscarelationshiptypes_toscarelationshiptype.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarelationshiptypes_toscarelationshiptype`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.sql
new file mode 100644
index 00000000..27dea650
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0770-toscarequirement.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarequirement`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.sql
new file mode 100644
index 00000000..5947ee02
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0780-toscarequirements.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarequirements`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.sql
new file mode 100644
index 00000000..855a39cc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0790-toscarequirements_toscarequirement.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscarequirements_toscarequirement`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.sql
new file mode 100644
index 00000000..0ff16713
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0800-toscaservicetemplate.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscaservicetemplate`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.sql
new file mode 100644
index 00000000..d2807853
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0810-toscatopologytemplate.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscatopologytemplate`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.sql
new file mode 100644
index 00000000..8282e52b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0820-toscatrigger.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `toscatrigger`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..fa180f20
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.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=========================================================
+ */
+
+ALTER TABLE toscanodetemplate DROP CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..7677f001
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0840-FK_ToscaNodeTemplate_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=========================================================
+ */
+
+ALTER TABLE toscanodetemplate DROP CONSTRAINT FK_ToscaNodeTemplate_requirementsName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0850-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..29e7ba60
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/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=========================================================
+ */
+
+ALTER TABLE toscanodetype DROP CONSTRAINT FK_ToscaNodeType_requirementsName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..4a13c709
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_capabilityTypesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..0f5f67a2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0870-FK_ToscaServiceTemplate_dataTypesName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_dataTypesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..49ab3064
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_nodeTypesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..63a233c6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0890-FK_ToscaServiceTemplate_policyTypesName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_policyTypesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..eca7ac66
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT FK_ToscaServiceTemplate_relationshipTypesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..427435de
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.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=========================================================
+ */
+
+ALTER TABLE toscatopologytemplate DROP CONSTRAINT FK_ToscaTopologyTemplate_nodeTemplatesName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..8d9627cc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0920-FK_ToscaTopologyTemplate_policyName.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=========================================================
+ */
+
+ALTER TABLE toscatopologytemplate DROP CONSTRAINT FK_ToscaTopologyTemplate_policyName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..8b9f863b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.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=========================================================
+ */
+
+ALTER TABLE toscaservicetemplate DROP CONSTRAINT TscaServiceTemplatetopologyTemplateParentLocalName;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..60b08a58
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..eae64df9
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaNodeTemplate_requirementsName ON toscanodetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..6854e12f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0960-FK_ToscaNodeType_requirementsName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaNodeType_requirementsName ON toscanodetype;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..a7e7159d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..6d590832
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..49199076
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..970669ac
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..b43d4142
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..c8aa8e6b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..e0b73a2e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1030-FK_ToscaTopologyTemplate_policyName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX FK_ToscaTopologyTemplate_policyName ON toscatopologytemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-IDX_TSIDX1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-IDX_TSIDX1.sql
new file mode 100644
index 00000000..0d2d4c69
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1040-IDX_TSIDX1.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX IDX_TSIDX1 ON pdpstatistics;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-PdpPolicyStatus_PdpGroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-PdpPolicyStatus_PdpGroup.sql
new file mode 100644
index 00000000..0507184e
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1050-PdpPolicyStatus_PdpGroup.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX PdpPolicyStatus_PdpGroup ON pdppolicystatus;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..96ddf0ed
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/downgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.sql
new file mode 100644
index 00000000..e38dba8d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0100-jpapdpgroup_properties.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 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/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.sql
new file mode 100644
index 00000000..0fe67f4f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0110-jpapdpstatistics_enginestats.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 jpapdpstatistics_enginestats (AVERAGEEXECUTIONTIME DOUBLE 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, ID BIGINT DEFAULT NULL NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.sql
new file mode 100644
index 00000000..a2159746
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0120-jpapdpsubgroup_policies.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 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/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.sql
new file mode 100644
index 00000000..84508c9a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0130-jpapdpsubgroup_properties.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 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/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.sql
new file mode 100644
index 00000000..323ee277
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0140-jpapdpsubgroup_supportedpolicytypes.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 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/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.sql
new file mode 100644
index 00000000..a097475f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0150-jpatoscacapabilityassignment_attributes.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 jpatoscacapabilityassignment_attributes (name VARCHAR(120) NULL, version VARCHAR(20) NULL, ATTRIBUTES LONGTEXT NULL, ATTRIBUTES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.sql
new file mode 100644
index 00000000..b7e22389
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0160-jpatoscacapabilityassignment_metadata.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 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/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.sql
new file mode 100644
index 00000000..c80aed43
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0170-jpatoscacapabilityassignment_occurrences.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 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/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.sql
new file mode 100644
index 00000000..4abf7708
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0180-jpatoscacapabilityassignment_properties.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 jpatoscacapabilityassignment_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.sql
new file mode 100644
index 00000000..48dac4a0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0190-jpatoscacapabilitytype_metadata.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 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/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.sql
new file mode 100644
index 00000000..861144ae
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0200-jpatoscacapabilitytype_properties.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 jpatoscacapabilitytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.sql
new file mode 100644
index 00000000..7b541244
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0210-jpatoscadatatype_constraints.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 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/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.sql
new file mode 100644
index 00000000..578c0411
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0220-jpatoscadatatype_metadata.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 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/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.sql
new file mode 100644
index 00000000..a4b985bf
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0230-jpatoscadatatype_properties.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 jpatoscadatatype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.sql
new file mode 100644
index 00000000..f1bb5dfd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0240-jpatoscanodetemplate_metadata.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 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/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.sql
new file mode 100644
index 00000000..36b297e6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0250-jpatoscanodetemplate_properties.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 jpatoscanodetemplate_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.sql
new file mode 100644
index 00000000..16741e3c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0260-jpatoscanodetype_metadata.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 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/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.sql
new file mode 100644
index 00000000..759906c8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0270-jpatoscanodetype_properties.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 jpatoscanodetype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.sql
new file mode 100644
index 00000000..8b3cdb78
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0280-jpatoscapolicy_metadata.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 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/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.sql
new file mode 100644
index 00000000..880cfbe2
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0290-jpatoscapolicy_properties.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 jpatoscapolicy_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.sql
new file mode 100644
index 00000000..0d910081
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0300-jpatoscapolicy_targets.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 jpatoscapolicy_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.sql
new file mode 100644
index 00000000..221baf9b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0310-jpatoscapolicytype_metadata.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 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/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.sql
new file mode 100644
index 00000000..f17763e3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0320-jpatoscapolicytype_properties.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 jpatoscapolicytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.sql
new file mode 100644
index 00000000..65b37002
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0330-jpatoscapolicytype_targets.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 jpatoscapolicytype_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.sql
new file mode 100644
index 00000000..61ea0dea
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0340-jpatoscapolicytype_triggers.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 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/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.sql
new file mode 100644
index 00000000..942c594c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0350-jpatoscaproperty_constraints.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 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/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.sql
new file mode 100644
index 00000000..96b519c3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0360-jpatoscaproperty_metadata.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 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/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.sql
new file mode 100644
index 00000000..2fd1ad64
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0370-jpatoscarelationshiptype_metadata.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 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/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.sql
new file mode 100644
index 00000000..272dbb81
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0380-jpatoscarelationshiptype_properties.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 jpatoscarelationshiptype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.sql
new file mode 100644
index 00000000..272227bd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0390-jpatoscarequirement_metadata.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 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/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.sql
new file mode 100644
index 00000000..9d645483
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0400-jpatoscarequirement_occurrences.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 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/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.sql
new file mode 100644
index 00000000..173fb4d0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0410-jpatoscarequirement_properties.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 jpatoscarequirement_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.sql
new file mode 100644
index 00000000..4267887d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0420-jpatoscaservicetemplate_metadata.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 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/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.sql
new file mode 100644
index 00000000..5f0b6a10
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0430-jpatoscatopologytemplate_inputs.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 jpatoscatopologytemplate_inputs (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, INPUTS LONGBLOB DEFAULT NULL NULL, INPUTS_KEY VARCHAR(255) NULL);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.sql
new file mode 100644
index 00000000..48fd2db0
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0440-pdpgroup_pdpsubgroup.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 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/sql/0800/upgrade/0450-pdpgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.sql
new file mode 100644
index 00000000..336c176d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0450-pdpgroup.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 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/sql/0800/upgrade/0460-pdppolicystatus.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.sql
new file mode 100644
index 00000000..9faa075b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0460-pdppolicystatus.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 pdppolicystatus (DEPLOY BIT DEFAULT 0 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/sql/0800/upgrade/0470-pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.sql
new file mode 100644
index 00000000..e325bdbc
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0470-pdp.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 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/sql/0800/upgrade/0480-pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.sql
new file mode 100644
index 00000000..79e7b95b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0480-pdpstatistics.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 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 datetime DEFAULT NULL NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.sql
new file mode 100644
index 00000000..852ef77f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0490-pdpsubgroup_pdp.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 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/sql/0800/upgrade/0500-pdpsubgroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.sql
new file mode 100644
index 00000000..381c9e01
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0500-pdpsubgroup.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 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/sql/0800/upgrade/0510-toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.sql
new file mode 100644
index 00000000..b3a308e8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0510-toscacapabilityassignment.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 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/sql/0800/upgrade/0520-toscacapabilityassignments.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.sql
new file mode 100644
index 00000000..a1071197
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0520-toscacapabilityassignments.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 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/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.sql
new file mode 100644
index 00000000..1ab54b8f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0530-toscacapabilityassignments_toscacapabilityassignment.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 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/sql/0800/upgrade/0540-toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.sql
new file mode 100644
index 00000000..39a094af
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0540-toscacapabilitytype.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 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/sql/0800/upgrade/0550-toscacapabilitytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.sql
new file mode 100644
index 00000000..778ec042
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0550-toscacapabilitytypes.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 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/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.sql
new file mode 100644
index 00000000..4f7f3787
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0560-toscacapabilitytypes_toscacapabilitytype.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 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/sql/0800/upgrade/0570-toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.sql
new file mode 100644
index 00000000..f22c3c69
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0570-toscadatatype.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 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/sql/0800/upgrade/0580-toscadatatypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.sql
new file mode 100644
index 00000000..df5dc545
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0580-toscadatatypes.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 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/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.sql
new file mode 100644
index 00000000..1cee4eba
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0590-toscadatatypes_toscadatatype.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 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/sql/0800/upgrade/0600-toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.sql
new file mode 100644
index 00000000..76b68809
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0600-toscanodetemplate.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 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/sql/0800/upgrade/0610-toscanodetemplates.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.sql
new file mode 100644
index 00000000..6c82b8da
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0610-toscanodetemplates.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 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/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.sql
new file mode 100644
index 00000000..5be6b268
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0620-toscanodetemplates_toscanodetemplate.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 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/sql/0800/upgrade/0630-toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.sql
new file mode 100644
index 00000000..3bad7c73
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0630-toscanodetype.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 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/sql/0800/upgrade/0640-toscanodetypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.sql
new file mode 100644
index 00000000..06a8a189
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0640-toscanodetypes.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 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/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.sql
new file mode 100644
index 00000000..70b19a11
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0650-toscanodetypes_toscanodetype.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 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/sql/0800/upgrade/0660-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.sql
new file mode 100644
index 00000000..77d61f5d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0660-toscaparameter.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 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/0800/upgrade/0670-toscapolicies.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.sql
new file mode 100644
index 00000000..a64b0779
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0670-toscapolicies.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 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/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.sql
new file mode 100644
index 00000000..dea2a44c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0680-toscapolicies_toscapolicy.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 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/sql/0800/upgrade/0690-toscapolicy.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.sql
new file mode 100644
index 00000000..a69b0215
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0690-toscapolicy.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 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/sql/0800/upgrade/0700-toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.sql
new file mode 100644
index 00000000..ef5c9d56
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0700-toscapolicytype.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 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/sql/0800/upgrade/0710-toscapolicytypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.sql
new file mode 100644
index 00000000..956faa48
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0710-toscapolicytypes.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 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/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.sql
new file mode 100644
index 00000000..e1442c74
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0720-toscapolicytypes_toscapolicytype.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 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/sql/0800/upgrade/0730-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.sql
new file mode 100644
index 00000000..5d1ef960
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0730-toscaproperty.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 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/0800/upgrade/0740-toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.sql
new file mode 100644
index 00000000..b007911d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0740-toscarelationshiptype.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 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/sql/0800/upgrade/0750-toscarelationshiptypes.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.sql
new file mode 100644
index 00000000..a07ab0db
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0750-toscarelationshiptypes.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 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/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.sql
new file mode 100644
index 00000000..883a98ce
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0760-toscarelationshiptypes_toscarelationshiptype.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 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/sql/0800/upgrade/0770-toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.sql
new file mode 100644
index 00000000..d29edfba
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0770-toscarequirement.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 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/sql/0800/upgrade/0780-toscarequirements.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.sql
new file mode 100644
index 00000000..6b2ac078
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0780-toscarequirements.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 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/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.sql
new file mode 100644
index 00000000..884ad903
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0790-toscarequirements_toscarequirement.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 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/sql/0800/upgrade/0800-toscaservicetemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.sql
new file mode 100644
index 00000000..396499fd
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0800-toscaservicetemplate.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 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/sql/0800/upgrade/0810-toscatopologytemplate.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.sql
new file mode 100644
index 00000000..92d51d92
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0810-toscatopologytemplate.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 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/sql/0800/upgrade/0820-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.sql
new file mode 100644
index 00000000..45862f8d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0820-toscatrigger.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 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/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..d96393d7
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0830-FK_ToscaNodeTemplate_capabilitiesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..491a6b70
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0840-FK_ToscaNodeTemplate_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=========================================================
+ */
+
+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/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0850-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..c6f37f5c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/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=========================================================
+ */
+
+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/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..2942032d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0860-FK_ToscaServiceTemplate_capabilityTypesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..42d1b16d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0870-FK_ToscaServiceTemplate_dataTypesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..ff40a80f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0880-FK_ToscaServiceTemplate_nodeTypesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..ac0aad0c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0890-FK_ToscaServiceTemplate_policyTypesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..a7526670
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0900-FK_ToscaServiceTemplate_relationshipTypesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..97bf345d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0910-FK_ToscaTopologyTemplate_nodeTemplatesName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..3a973499
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0920-FK_ToscaTopologyTemplate_policyName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..ca03af86
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0930-TscaServiceTemplatetopologyTemplateParentLocalName.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=========================================================
+ */
+
+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/sql/0800/upgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.sql
new file mode 100644
index 00000000..e3597b48
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0940-FK_ToscaNodeTemplate_capabilitiesName.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_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate(capabilitiesName, capabilitiesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-FK_ToscaNodeTemplate_requirementsName.sql
new file mode 100644
index 00000000..06c389c1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0950-FK_ToscaNodeTemplate_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_ToscaNodeTemplate_requirementsName ON toscanodetemplate(requirementsName, requirementsVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeType_requirementsName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-FK_ToscaNodeType_requirementsName.sql
new file mode 100644
index 00000000..1ee32de8
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0960-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/sql/0800/upgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.sql
new file mode 100644
index 00000000..89d0a95f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0970-FK_ToscaServiceTemplate_capabilityTypesName.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_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate(capabilityTypesName, capabilityTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaServiceTemplate_dataTypesName.sql
new file mode 100644
index 00000000..23b1d8ca
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0980-FK_ToscaServiceTemplate_dataTypesName.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_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate(dataTypesName, dataTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.sql
new file mode 100644
index 00000000..b8701265
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/0990-FK_ToscaServiceTemplate_nodeTypesName.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_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate(nodeTypesName, nodeTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_policyTypesName.sql
new file mode 100644
index 00000000..247cd817
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1000-FK_ToscaServiceTemplate_policyTypesName.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_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate(policyTypesName, policyTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.sql
new file mode 100644
index 00000000..f9ca8b99
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1010-FK_ToscaServiceTemplate_relationshipTypesName.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_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate(relationshipTypesName, relationshipTypesVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
new file mode 100644
index 00000000..b538f8ee
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1020-FK_ToscaTopologyTemplate_nodeTemplatesName.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_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate(nodeTemplatesName, nodeTemplatessVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaTopologyTemplate_policyName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaTopologyTemplate_policyName.sql
new file mode 100644
index 00000000..bd25f3a5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1030-FK_ToscaTopologyTemplate_policyName.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_ToscaTopologyTemplate_policyName ON toscatopologytemplate(policyName, policyVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-IDX_TSIDX1.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-IDX_TSIDX1.sql
new file mode 100644
index 00000000..ba63f55c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1040-IDX_TSIDX1.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 IDX_TSIDX1 ON pdpstatistics(TIMESTAMP, name, version);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-PdpPolicyStatus_PdpGroup.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-PdpPolicyStatus_PdpGroup.sql
new file mode 100644
index 00000000..d16c3ced
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1050-PdpPolicyStatus_PdpGroup.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 PdpPolicyStatus_PdpGroup ON pdppolicystatus(PDPGROUP);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
new file mode 100644
index 00000000..0fe51970
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0800/upgrade/1060-TscaServiceTemplatetopologyTemplateParentLocalName.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 TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate(topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-jpapolicyaudit.sql
new file mode 100644
index 00000000..7eb7b9c1
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0100-jpapolicyaudit.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=========================================================
+ */
+
+DROP TABLE IF EXISTS `jpapolicyaudit`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-sequence.sql
new file mode 100644
index 00000000..8043289c
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0110-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=========================================================
+ */
+
+DROP TABLE IF EXISTS `sequence`;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-JpaPolicyAuditIndex_timestamp.sql
new file mode 100644
index 00000000..275d3b10
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/downgrade/0120-JpaPolicyAuditIndex_timestamp.sql
@@ -0,0 +1,24 @@
+/*
+ * ============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=========================================================
+ */
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-jpapolicyaudit.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-jpapolicyaudit.sql
new file mode 100644
index 00000000..a31d2421
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0100-jpapolicyaudit.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 jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime 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/sql/0900/upgrade/0110-sequence.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-sequence.sql
new file mode 100644
index 00000000..64d6f01b
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0110-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/sql/0900/upgrade/0120-JpaPolicyAuditIndex_timestamp.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-JpaPolicyAuditIndex_timestamp.sql
new file mode 100644
index 00000000..d789d118
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0120-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/db-migrator b/policy-db-migrator/src/main/docker/db-migrator
new file mode 100644
index 00000000..9065220a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/db-migrator
@@ -0,0 +1,632 @@
+#!/usr/bin/env sh
+
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications 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.
+# ============LICENSE_END=========================================================
+
+# #####################################################################
+#
+# Upgrade/Downgrade SQL File Name Format:
+#
+# <VERSION>-<pdp|feature-name>[-description](.upgrade|.downgrade).sql
+#
+# This tool operates on a migration working directory at
+#
+# $POLICY_HOME/etc/db/migration
+#
+# Upgrade/Downgrade files for each schema (aka database) names to be maintained
+# by this tool are located at
+#
+# $POLICY_HOME/etc/db/migration/<schema-name>/sql
+#
+# The nature of the migration directories is dynamic.
+# A number of environment variables needs to be initialized
+# prior to running db-migrator.
+# These vaiables specifiy the connection details for the database
+# to be upgraded/downgraded.
+#
+# The repository of upgrade/downgrade scripts is located in the
+# /home/policy/sql directory.
+# Two additional scripts have been provided to prepare the directories/files
+# needed to perform the upgrade/downgrade.
+#
+# At any given time the following invariant must be preserved in any given
+# $POLICY_HOME/etc/db/migration/<schema-name>/sql directory
+#
+# There is only upgrade scripts, or only downgrade scripts, or none.
+#
+# #####################################################################
+
+source ${POLICY_HOME}/etc/profile.d/env.sh
+
+METADATA_DB=migration
+METADATA_TABLE=${METADATA_DB}.db_metadata_versions
+MIGRATION_DIR=${POLICY_HOME}/etc/db/migration
+ZERO_VERSION="0"
+UPGRADE_SQL_SUFFIX=".upgrade.sql"
+DOWNGRADE_SQL_SUFFIX=".downgrade.sql"
+
+SQL_QUOTES="SET SESSION SQL_MODE=ANSI_QUOTES;"
+
+#####################################################
+# usage
+#####################################################
+
+function usage() {
+ echo
+ echo -e "syntax: $(basename "$0") "
+ echo -e "\t -s <schema-name> "
+ echo -e "\t [-b <migration-dir>] "
+ echo -e "\t [-f <from-version>]"
+ echo -e "\t [-t <target-version>]"
+ echo -e "\t -o <operations> "
+ echo
+ echo -e "\t where <operations>=upgrade|downgrade|auto|version|erase|report"
+ echo
+ echo
+ echo -e "Configuration Options:"
+ echo -e "\t -s|--schema|--database: schema to operate on ('ALL' to apply on all)"
+ echo -e "\t -b|--basedir: overrides base DB migration directory"
+ echo -e "\t -f|--from: overrides current release version for operations"
+ echo -e "\t -t|--target: overrides target release to upgrade/downgrade"
+ echo
+ echo -e "Operations:"
+ echo -e "\t upgrade: upgrade operation"
+ echo -e "\t downgrade: performs a downgrade operation"
+ echo -e "\t auto: autonomous operation, determines upgrade or downgrade"
+ echo -e "\t version: returns current version, and in conjunction if '-f' sets the current version"
+ echo -e "\t erase: erase all data related <schema> (use with care)"
+ echo -e "\t report: migration detailed report on an schema"
+ echo -e "\t ok: is the migration status valid"
+ echo
+ echo
+}
+
+#####################################################
+# ensure global metadata
+#####################################################
+
+function ensure_metadata
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- ensure_metadata --"
+ set -x
+ fi
+
+ local sql rc
+
+ sql="CREATE DATABASE IF NOT EXISTS ${METADATA_DB};"
+ ${MYSQL} --execute "${sql}"
+ rc=$?
+ if [ ${rc} -ne 0 ]; then
+ return ${rc}
+ fi
+
+ sql="CREATE TABLE IF NOT EXISTS ${METADATA_TABLE} "
+ sql=${sql}"(name VARCHAR(60) NOT NULL, version VARCHAR(20), "
+ sql=${sql}"PRIMARY KEY(name));"
+ ${MYSQL} --execute "${sql}"
+ return $?
+}
+
+
+#####################################################
+# ensure metadata on a per schema basis
+#####################################################
+
+function ensure_metadata_schema
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- ensure_metadata_schema --"
+ set -x
+ fi
+
+ local sql rc
+
+ sql="CREATE TABLE IF NOT EXISTS ${METADATA_HISTORY} "
+ sql=${sql}"(script VARCHAR(80) NOT NULL, "
+ sql=${sql}"operation VARCHAR(10), from_version VARCHAR(20), to_version VARCHAR(20), success VARCHAR(1), "
+ sql=${sql}"atTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "
+ sql=${sql}"PRIMARY KEY(to_version, script, operation));"
+ ${MYSQL} --execute "${sql}"
+ rc=$?
+ if [ ${rc} -ne 0 ]; then
+ return ${rc}
+ fi
+
+ sql="CREATE DATABASE IF NOT EXISTS ${SCHEMA_DB};"
+ ${MYSQL} --execute "${sql}"
+ return $?
+}
+
+
+#####################################################
+# target_release
+#####################################################
+
+function target_release
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- target_release --"
+ set -x
+ fi
+
+ local sql sqlName upgradeSqls downgradeSqls
+
+ TARGET_UPGRADE_RELEASE=${ZERO_VERSION}
+ TARGET_DOWNGRADE_RELEASE=${ZERO_VERSION}
+
+ upgradeSqls=$(ls -v -r "${UPGRADE_DIR}"/*/upgrade/*.sql 2> /dev/null)
+ for sql in ${upgradeSqls}; do
+ TARGET_UPGRADE_RELEASE="$(basename $(dirname $(dirname $sql)))"
+ break
+ done
+
+ # default unless overriden
+ TARGET_DOWNGRADE_RELEASE="${ZERO_VERSION}"
+}
+
+#####################################################
+# is_upgrade
+#####################################################
+
+function is_upgrade
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- is_upgrade --"
+ set -x
+ fi
+
+ local upgradeSqls
+
+ upgradeSqls=$(ls -v "${UPGRADE_DIR}"/*/upgrade/*.sql 2> /dev/null)
+ if [ -z "${upgradeSqls}" ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+
+#####################################################
+# is_downgrade
+#####################################################
+
+function is_downgrade
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- is_downgrade --"
+ set -x
+ fi
+
+ local downgradeSqls
+
+ downgradeSqls=$(ls -v -r "${DOWNGRADE_DIR}"/*/downgrade/*.sql 2> /dev/null)
+ if [ -z "${downgradeSqls}" ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+
+#####################################################
+# set_current_release
+#####################################################
+
+function set_current_release
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- set_current_release --"
+ set -x
+ fi
+
+ CURRENT_RELEASE="${1}"
+
+ local sql
+ sql="INSERT INTO ${METADATA_TABLE} (name, version) "
+ sql=${sql}"VALUES('${SCHEMA}', '${CURRENT_RELEASE}') "
+ sql=${sql}"ON DUPLICATE KEY UPDATE version='${CURRENT_RELEASE}';"
+
+ ${MYSQL} --execute "${sql}"
+ return $?
+}
+
+#####################################################
+# current_release
+#####################################################
+
+function current_release
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- current_release --"
+ set -x
+ fi
+
+ local rc
+ local query="SELECT version FROM ${METADATA_TABLE} WHERE name='${SCHEMA}'"
+
+ CURRENT_RELEASE=$(${MYSQL} --skip-column-names --silent --execute "${query}")
+ if [ -z "${CURRENT_RELEASE}" ]; then
+ set_current_release "${ZERO_VERSION}"
+ return $?
+ fi
+
+ return 0
+}
+
+#####################################################
+# execute sql script history
+#####################################################
+
+function track_script
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- track_script $* --"
+ set -x
+ fi
+
+ local script="${1}" operation="${2}" success="${3}" to_version="${4}"
+ if [ $operation == "downgrade" ]; then
+ to_version=${TARGET_DOWNGRADE_RELEASE}
+ fi
+ from_version=${CURRENT_RELEASE}
+ local sql="INSERT INTO ${METADATA_HISTORY}(script,operation,from_version,to_version,success,atTime) "
+ sql=${sql}"VALUES ('${script}','${operation}','${from_version}','${to_version}','${success}',now()) "
+ sql=${sql}"ON DUPLICATE KEY UPDATE operation=values(operation),from_version=values(from_version),"
+ sql=${sql}"success=values(success), atTime=values(atTime);"
+
+ ${MYSQL} --execute "${sql}"
+ return $?
+}
+
+
+#####################################################
+# execute sql script
+#####################################################
+
+function run_script
+{
+ if [ "${DEBUG}" == "y" ]; then
+ echo "-- run_script $* --"
+ set -x
+ fi
+
+ local operation="${1}" script="${2}" scriptPath="${3}" schemaVersion="${4}"
+
+ echo
+ echo "> ${operation} ${script}"
+
+ ${MYSQL} ${SCHEMA} --verbose < "${scriptPath}"
+ local rc=$?
+ if [ ${rc} -ne 0 ]; then
+ success="0"
+ else
+ success="1"
+ fi
+
+ track_script "${script}" "${operation}" "${success}" "${schemaVersion}"
+
+ return ${rc}
+}
+
+#####################################################
+# upgrade
+#####################################################
+
+function upgrade
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- upgrade --"
+ set -x
+ fi
+
+ local sqlName sqlFile schemaVersion upgradeSqls rc
+
+ ${MYSQL} --execute "USE ${SCHEMA_DB}"
+
+ echo "upgrade: ${CURRENT_RELEASE} -> ${TARGET_UPGRADE_RELEASE}"
+
+ if [ ${CURRENT_RELEASE} \< ${TARGET_UPGRADE_RELEASE} ]; then
+ upgradeSqls=$(ls -v "${UPGRADE_DIR}"/*/upgrade/*.sql 2> /dev/null)
+ for sqlFile in ${upgradeSqls}; do
+ sqlName=$(basename "${sqlFile}")
+ schemaVersion="$(basename $(dirname $(dirname $sqlFile)))"
+ if [ "${schemaVersion}" -gt "${CURRENT_RELEASE}" ] && \
+ [ "${schemaVersion}" -le "${TARGET_UPGRADE_RELEASE}" ]; then
+ run_script "upgrade" "${sqlName}" "${sqlFile}" "${schemaVersion}"
+ rc=$?
+ if [ ${rc} -ne 0 ]; then
+ echo "${SCHEMA}: upgrade aborted at ${schemaVersion} by script ${sqlName}"
+ set_current_release "${schemaVersion}"
+ return ${rc}
+ fi
+ fi
+ done
+
+ set_current_release "${TARGET_UPGRADE_RELEASE}"
+ fi
+
+ return 0
+}
+
+#####################################################
+# downgrade
+#####################################################
+
+function downgrade
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- downgrade --"
+ set -x
+ fi
+
+ local sqlName sqlFile schemaVersion downgradeSqls rc
+
+ ${MYSQL} --execute "USE ${SCHEMA_DB}"
+
+ echo "downgrade: ${CURRENT_RELEASE} -> ${TARGET_DOWNGRADE_RELEASE}"
+
+ if [ ${CURRENT_RELEASE} \> ${TARGET_DOWNGRADE_RELEASE} ]; then
+ downgradeSqls=$(ls -v -r "${DOWNGRADE_DIR}"/*/downgrade/*.sql 2> /dev/null)
+ for sqlFile in ${downgradeSqls}; do
+ sqlName=$(basename "${sqlFile}")
+ schemaVersion="$(basename $(dirname $(dirname $sqlFile)))"
+ if [ "${schemaVersion}" -le "${CURRENT_RELEASE}" ] && \
+ [ "${schemaVersion}" -gt "${TARGET_DOWNGRADE_RELEASE}" ]; then
+ run_script "downgrade" "${sqlName}" "${sqlFile}" "${schemaVersion}"
+ rc=$?
+ if [ ${rc} -ne 0 ]; then
+ echo "${SCHEMA}: downgrade aborted at ${schemaVersion} by script ${sqlName}"
+ set_current_release "${schemaVersion}"
+ return ${rc}
+ fi
+ fi
+ done
+
+ set_current_release "${TARGET_DOWNGRADE_RELEASE}"
+ fi
+
+ return 0
+}
+
+#####################################################
+# erase
+#####################################################
+
+function erase
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- erase --"
+ set -x
+ fi
+
+ local updateMetadata="UPDATE ${METADATA_TABLE} SET version='${ZERO_VERSION}';"
+ ${MYSQL} --execute "${updateMetadata}"
+
+ local deleteHistory="DELETE FROM ${METADATA_HISTORY};"
+ ${MYSQL} --execute "${deleteHistory}"
+
+ local dropDB="DROP DATABASE IF EXISTS ${SCHEMA_DB}";
+ ${MYSQL} --execute "${dropDB}"
+}
+
+#####################################################
+# report
+#####################################################
+
+function report
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- report --"
+ set -x
+ fi
+
+ local versionSql="SELECT * FROM ${METADATA_TABLE} WHERE name='${SCHEMA}';"
+ ${MYSQL} --execute "${versionSql}"
+
+ local historySql="SELECT * FROM ${METADATA_HISTORY} ORDER BY atTime ASC;"
+ ${MYSQL} --execute "${historySql}"
+
+ okay
+}
+
+function okay
+{
+ if [ "${DEBUG}" = "y" ]; then
+ echo "-- okay --"
+ set -x
+ fi
+
+ local rc=0
+ if is_upgrade; then
+ if [ "${CURRENT_RELEASE}" = "${TARGET_UPGRADE_RELEASE}" ]; then
+ echo "${SCHEMA}: OK @ ${CURRENT_RELEASE}"
+ else
+ echo "${SCHEMA}: upgrade available: ${CURRENT_RELEASE} -> ${TARGET_UPGRADE_RELEASE}"
+ rc=1
+ fi
+ else
+ if [ "${CURRENT_RELEASE}" = "${TARGET_DOWNGRADE_RELEASE}" ]; then
+ echo "${SCHEMA}: OK @ ${CURRENT_RELEASE}"
+ else
+ echo "${SCHEMA}: downgrade available: ${CURRENT_RELEASE} -> ${TARGET_DOWNGRADE_RELEASE}"
+ rc=1
+ fi
+ fi
+
+ return ${rc}
+}
+
+#####################################################
+# MAIN
+#####################################################
+
+if [ "${DEBUG}" = "y" ]; then
+ echo "-- $0 $* --"
+ set -x
+fi
+until [ -z "$1" ]; do
+ case $1 in
+ -s|--schema|--database) shift
+ SCHEMA=$1
+ ;;
+ -b|--basedir) shift
+ MIGRATION_DIR=$1
+ ;;
+ -t|--target) shift
+ INPUT_TARGET_RELEASE=$1
+ ;;
+ -f|--from) shift
+ INPUT_CURRENT_RELEASE=$1
+ ;;
+ -o|--operation) shift
+ OPERATION=$1
+ ;;
+ *) usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+case ${OPERATION} in
+ upgrade) ;;
+ downgrade) ;;
+ auto) ;;
+ version) ;;
+ erase) ;;
+ report) ;;
+ ok) ;;
+ *) echo "error: invalid operation provided"
+ usage
+ exit 1
+ ;;
+esac
+
+if [ -z "${SCHEMA}" ]; then
+ echo "error: a database name must be provided"
+ usage
+ exit 2
+fi
+
+source "${POLICY_HOME}"/etc/profile.d/env.sh
+
+if [ -z "${SQL_HOST}" ] || [ -z "${SQL_USER}" ] || [ -z "${SQL_PASSWORD}" ]; then
+ echo "error: no database has been set up"
+ exit 4
+fi
+
+MYSQL="mysql -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST}";
+if ! ${MYSQL} -h"${SQL_HOST}" --execute "show databases;" > /dev/null 2>&1; then
+ echo "error: No DB connectivity to ${SQL_HOST} for ${SQL_USER}"
+ exit 5
+fi
+
+if [ "${SCHEMA}" = "ALL" ]; then
+ SCHEMA="*"
+fi
+
+SCHEMA_S=$(ls -d "${MIGRATION_DIR}"/${SCHEMA}/ 2> /dev/null)
+if [ -z "${SCHEMA_S}" ]; then
+ echo "error: no databases available"
+ exit 0
+fi
+
+if ! ensure_metadata; then
+ echo "error: migration metadata not accessible"
+ exit 7
+fi
+
+rc=0
+for dbPath in ${SCHEMA_S}; do
+ SCHEMA=$(basename "${dbPath}")
+ SCHEMA_DB="\`${SCHEMA}\`"
+ UPGRADE_DIR="${MIGRATION_DIR}"/"${SCHEMA}"/sql
+ DOWNGRADE_DIR=${UPGRADE_DIR}
+ METADATA_HISTORY="${METADATA_DB}.\`${SCHEMA}_change_history\`"
+ TARGET_RELEASE=${INPUT_TARGET_RELEASE}
+ CURRENT_RELEASE=${INPUT_CURRENT_RELEASE}
+
+ if is_upgrade && is_downgrade; then
+ echo "${SCHEMA}: failure: invalid configuration: ${UPGRADE_SQL_SUFFIX} and "\
+ "${DOWNGRADE_SQL_SUFFIX} exist under ${DOWNGRADE_DIR}"
+ rc=1
+ continue
+ fi
+
+ if [ "${operation}" = "auto" ]; then
+ if is_upgrade; then
+ operation=upgrade
+ else
+ operation=downgrade
+ fi
+ fi
+
+ if ! ensure_metadata_schema; then
+ echo "${SCHEMA}: failure: metadata not accessible for this schema"
+ continue
+ fi
+
+ if [ -z "${TARGET_RELEASE}" ]; then
+ target_release
+ else
+ # user asked to override
+ TARGET_UPGRADE_RELEASE="${TARGET_RELEASE}"
+ TARGET_DOWNGRADE_RELEASE="${TARGET_RELEASE}"
+ fi
+
+ if [ -z "${CURRENT_RELEASE}" ]; then
+ if ! current_release; then
+ echo "${SCHEMA}: failure: cannot obtain current release"
+ continue
+ fi
+ else
+ if ! set_current_release "${CURRENT_RELEASE}"; then
+ echo "${SCHEMA}: failure: cannot set current release"
+ continue
+ fi
+ fi
+
+ case ${OPERATION} in
+ upgrade) if upgrade; then
+ echo "${SCHEMA}: OK: upgrade (${CURRENT_RELEASE})"
+ else
+ rc=1
+ echo "${SCHEMA}: failure: upgrade to release ${TARGET_UPGRADE_RELEASE} (${CURRENT_RELEASE})"
+ fi
+ ;;
+ downgrade) if downgrade; then
+ echo "${SCHEMA}: OK: downgrade (${CURRENT_RELEASE})"
+ else
+ rc=1
+ echo "${SCHEMA}: failure: downgrade to release ${TARGET_DOWNGRADE_RELEASE} (${CURRENT_RELEASE})"
+ fi
+ ;;
+ version) echo "${SCHEMA}: ${CURRENT_RELEASE}"
+ ;;
+ erase) erase
+ ;;
+ report) report
+ ;;
+ ok) okay
+ ;;
+ esac
+
+done
+exit $rc
diff --git a/policy-db-migrator/src/main/docker/env.sh b/policy-db-migrator/src/main/docker/env.sh
new file mode 100644
index 00000000..1a4d067f
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/env.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+###
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2017-2021 AT&T Intellectual Property. 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.
+# ============LICENSE_END=========================================================
+###
+
+
+# some non-docker environments may set up POLICY_HOME
+# as a templated installation var (ie. ${{x}}) instead of
+# an environment variable (case of docker passed to the
+# container). The following condition accommodates that
+# scenario.
+
+templateRegex='^\$\{\{POLICY_HOME}}$'
+
+if [ -z "${POLICY_HOME}" ]; then
+ templatedPolicyHome='${{POLICY_HOME}}'
+ if [[ ! ${templatedPolicyHome} =~ ${templateRegex} ]]; then
+ POLICY_HOME=${templatedPolicyHome}
+ fi
+fi
+
+set -a
+
+POLICY_HOME=${POLICY_HOME:=/opt/app/policy}
+
+if ls "${POLICY_HOME}"/etc/profile.d/*.conf > /dev/null 2>&1; then
+ for conf in "${POLICY_HOME}"/etc/profile.d/*.conf ; do
+ source ${conf}
+ done
+fi
+
+for x in "${POLICY_HOME}"/bin "${JAVA_HOME}"/bin "${HOME}"/bin ; do
+ if [ -d $x ] ; then
+ case ":$PATH:" in
+ *":$x:"*) :;; # already there
+ *) PATH="$x:$PATH";;
+ esac
+ fi
+done
+
+set +a
diff --git a/policy-db-migrator/src/main/docker/prepare_downgrade.sh b/policy-db-migrator/src/main/docker/prepare_downgrade.sh
new file mode 100644
index 00000000..004873c5
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/prepare_downgrade.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+# ============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=========================================================
+
+if [ $# -lt 1 ]; then
+ echo "args: schema-name" >&2
+ exit 1
+fi
+
+export SCHEMA=$1
+export POLICY_HOME=/opt/app/policy
+export operation=downgrade
+
+cd $POLICY_HOME
+
+# Create schema directory for upgrade
+mkdir -p $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/
+# Remove any files from previous operations
+rm -rf $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/* 2>/dev/null
+# Copy files to downgrade directories
+cd /home/policy/sql && find . -type f -not -path '*/upgrade/*' -not -path '*/upgrade' -print0 \
+ | cpio --null -pud $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/
+
+releases=$(find $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/*/downgrade -type d | sort -u | rev | cut -f2 -d/ | rev)
+for release in $releases
+do
+ echo "Preparing $operation release version: $release"
+done
+echo "Done"
diff --git a/policy-db-migrator/src/main/docker/prepare_upgrade.sh b/policy-db-migrator/src/main/docker/prepare_upgrade.sh
new file mode 100644
index 00000000..b8a6a6d3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/prepare_upgrade.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+# ============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=========================================================
+
+if [ $# -lt 1 ]; then
+ echo "args: schema-name" >&2
+ exit 1
+fi
+
+export SCHEMA=$1
+export POLICY_HOME=/opt/app/policy
+export operation=upgrade
+
+cd $POLICY_HOME
+
+# Create schema directory for upgrade
+mkdir -p $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/
+# Remove any files from previous operations
+rm -rf $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/* 2>/dev/null
+# Copy files to upgrade directories
+cd /home/policy/sql && find . -type f -not -path '*/downgrade/*' -not -path '*/downgrade' -print0 \
+ | cpio --null -pud $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/
+
+releases=$(find $POLICY_HOME/etc/db/migration/${SCHEMA}/sql/*/upgrade -type d | sort -u | rev | cut -f2 -d/ | rev)
+for release in $releases
+do
+ echo "Preparing $operation release version: $release"
+done
+echo "Done"