Fix issues in existing entity classes 35/126535/1
authora.sreekumar <ajith.sreekumar@bell.ca>
Mon, 10 Jan 2022 14:42:00 +0000 (14:42 +0000)
committera.sreekumar <ajith.sreekumar@bell.ca>
Mon, 10 Jan 2022 14:42:05 +0000 (14:42 +0000)
Change-Id: I862a5c413f5cf4d0e472a527cd6dc5a32c28459c
Issue-ID: POLICY-3871
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
12 files changed:
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql [new file with mode: 0644]

diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0100-jpatoscapolicy_targets.sql
new file mode 100644 (file)
index 0000000..ec1da67
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicy_targets DROP COLUMN toscaPolicyName, DROP COLUMN toscaPolicyVersion;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0110-jpatoscapolicytype_targets.sql
new file mode 100644 (file)
index 0000000..b08a2ab
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_targets DROP COLUMN toscaPolicyTypeName, DROP COLUMN toscaPolicyTypeVersion;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0120-toscatrigger.sql
new file mode 100644 (file)
index 0000000..d701bd4
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition LONGBLOB DEFAULT NULL NULL, toscaConstraint LONGBLOB DEFAULT NULL NULL, `DESCRIPTION` VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, `PERIOD` LONGBLOB DEFAULT NULL NULL, SCHEDULE LONGBLOB DEFAULT NULL NULL, TARGETFILTER LONGBLOB DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_TOSCATRIGGER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0130-jpatoscapolicytype_triggers.sql
new file mode 100644 (file)
index 0000000..3586430
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0;the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers VARCHAR(255);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0140-toscaparameter.sql
new file mode 100644 (file)
index 0000000..51db2ab
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPARAMETER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/downgrade/0150-toscaproperty.sql
new file mode 100644 (file)
index 0000000..eef07f9
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+CREATE TABLE IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL);
+CREATE TABLE IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL);
+CREATE TABLE IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, ENTRYSCHEMA LONGBLOB DEFAULT NULL NULL, REQUIRED BIT DEFAULT 0 NULL, STATUS INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPROPERTY PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName));
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0100-jpatoscapolicy_targets.sql
new file mode 100644 (file)
index 0000000..aab9f36
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicy_targets ADD COLUMN toscaPolicyName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICY_TARGETS PRIMARY KEY (toscaPolicyName, toscaPolicyVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0110-jpatoscapolicytype_targets.sql
new file mode 100644 (file)
index 0000000..e4a5d75
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_targets ADD COLUMN toscaPolicyTypeName VARCHAR(120) NOT NULL, ADD COLUMN toscaPolicyTypeVersion VARCHAR(20) NOT NULL, ADD CONSTRAINT PK_JPATOSCAPOLICYTYPE_TARGETS PRIMARY KEY (toscaPolicyTypeName, toscaPolicyTypeVersion);
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0120-toscatrigger.sql
new file mode 100644 (file)
index 0000000..2d5d6e8
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0;the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+DROP TABLE IF EXISTS toscatrigger;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0130-jpatoscapolicytype_triggers.sql
new file mode 100644 (file)
index 0000000..b0907e1
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0;the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE jpatoscapolicytype_triggers MODIFY COLUMN triggers LONGBLOB;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0140-toscaparameter.sql
new file mode 100644 (file)
index 0000000..82ec7a2
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+DROP TABLE IF EXISTS toscaparameter;
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/1000/upgrade/0150-toscaproperty.sql
new file mode 100644 (file)
index 0000000..f270ae4
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+DROP TABLE IF EXISTS jpatoscaproperty_constraints;
+DROP TABLE IF EXISTS jpatoscaproperty_metadata;
+DROP TABLE IF EXISTS toscaproperty;