summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@att.com>2021-01-28 12:05:30 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2021-01-28 12:05:30 -0500
commit2eb54b38105676d6e02749f675c8c9b626a0ef35 (patch)
tree033ad1a5b52fca109898b88e8871282c439f0f0a /adapters/mso-catalog-db-adapter
parentf1235657951f714a394f1cfc7aef08af05620be4 (diff)
force not null with default values
force not null with default values update JUnit test setting default value update NULL fields before altering column sync beans with flyway changes updating test schema.sql files Issue-ID: SO-3494 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I53f000531cfb653a20bfdfae274622553420cdc8
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql25
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json1
2 files changed, 26 insertions, 0 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql
new file mode 100644
index 0000000000..068ffc447e
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql
@@ -0,0 +1,25 @@
+use catalogdb;
+
+UPDATE network_resource SET ORCHESTRATION_MODE = 'HEAT' WHERE ORCHESTRATION_MODE IS NULL;
+UPDATE vf_module_customization SET INITIAL_COUNT = '0' WHERE INITIAL_COUNT IS NULL;
+UPDATE vf_module_customization SET MIN_INSTANCES = '0' WHERE MIN_INSTANCES IS NULL;
+UPDATE workflow SET ARTIFACT_CHECKSUM = 'RECORD' WHERE ARTIFACT_CHECKSUM IS NULL;
+UPDATE identity_services SET ADMIN_PROJECT_DOMAIN_NAME = 'Default' WHERE ADMIN_PROJECT_DOMAIN_NAME IS NULL;
+UPDATE vnf_resource_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE pnf_resource_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE vnf_resource_customization SET NF_DATA_VALID = 0 WHERE NF_DATA_VALID IS NULL;
+UPDATE cloud_sites SET SUPPORT_FABRIC = 1 WHERE SUPPORT_FABRIC IS NULL;
+UPDATE service SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE vf_module_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+
+ALTER TABLE network_resource MODIFY ORCHESTRATION_MODE varchar(20) NOT NULL DEFAULT 'HEAT';
+ALTER TABLE vf_module_customization MODIFY INITIAL_COUNT int(11) NOT NULL DEFAULT '0';
+ALTER TABLE vf_module_customization MODIFY MIN_INSTANCES int(11) NOT NULL DEFAULT '0';
+ALTER TABLE workflow MODIFY ARTIFACT_CHECKSUM VARCHAR(200) NOT NULL DEFAULT 'MANUAL RECORD';
+ALTER TABLE identity_services MODIFY ADMIN_PROJECT_DOMAIN_NAME varchar(255) NOT NULL DEFAULT 'Default';
+ALTER TABLE vnf_resource_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE pnf_resource_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE vnf_resource_customization MODIFY NF_DATA_VALID tinyint(1) NOT NULL DEFAULT 0;
+ALTER TABLE cloud_sites MODIFY SUPPORT_FABRIC bit(1) NOT NULL DEFAULT 1;
+ALTER TABLE service MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE vf_module_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true; \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
index 2dc83c8963..c99b185557 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
@@ -31,6 +31,7 @@
"cloudVersionMax": "cloudVersionMax",
"category": "category",
"subCategory": "subCategory",
+ "nfDataValid": false,
"vfModule": [
{
"modelVersionId": "modelUUID",