From 6addc71625d4ae32d74908fbeb0ce975f2fded9a Mon Sep 17 00:00:00 2001
From: subhash kumar singh <subhash.kumar.singh@huawei.com>
Date: Fri, 14 Dec 2018 20:02:29 +0530
Subject: update request input and sequence to DB

Update request input and sequence to DB.
Resource sequence has been added as new column in service table.
Resource input has been added as new column in resp resource.

Change-Id: I97c8227636f06692190a843a87178517db038bbd
Issue-ID: SO-1248
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
---
 adapters/mso-openstack-adapters/src/test/resources/schema.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'adapters/mso-openstack-adapters/src/test/resources/schema.sql')

diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index a051417cc1..eff5c632fa 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -28,6 +28,7 @@ create table `allotted_resource_customization` (
   `min_instances` int(11) default null,
   `max_instances` int(11) default null,
   `ar_model_uuid` varchar(200) not null,
+  `resource_input` varchar(2000) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   primary key (`model_customization_uuid`),
   key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -168,6 +169,7 @@ create table `network_resource_customization` (
   `network_scope` varchar(45) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   `network_resource_model_uuid` varchar(200) not null,
+  `resource_input` varchar(2000) default null,
   primary key (`model_customization_uuid`),
   key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
   constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -203,6 +205,7 @@ create table `service` (
   `service_role` varchar(200) default null,
   `environment_context` varchar(200) default null,
   `workload_context` varchar(200) default null,
+  `resource_order` varchar(200) default null,
   primary key (`model_uuid`),
   key `fk_service__tosca_csar1_idx` (`tosca_csar_artifact_uuid`),
   constraint `fk_service__tosca_csar1` foreign key (`tosca_csar_artifact_uuid`) references `tosca_csar` (`artifact_uuid`) on delete cascade on update cascade
@@ -381,6 +384,7 @@ create table `vnf_resource_customization` (
   `creation_timestamp` datetime not null default current_timestamp,
   `vnf_resource_model_uuid` varchar(200) not null,
   `multi_stage_design` varchar(20) default null,
+  `resource_input` varchar(2000) default null,
   primary key (`model_customization_uuid`),
   key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
   constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
-- 
cgit 1.2.3-korg


From f6f326e8fba5d2b208a8530f9ec292b3cd351895 Mon Sep 17 00:00:00 2001
From: subhash kumar singh <subhash.kumar.singh@huawei.com>
Date: Thu, 17 Jan 2019 14:28:43 +0530
Subject: Change size for resource input

Change size for resource input.

Change-Id: Ic6856e6baa2623867d0ae688c98ed24dbb245036
Issue-ID: SO-1400
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
---
 .../db/migration/V4.23__ChangeResourceInputLength.sql          | 10 ++++++++++
 adapters/mso-openstack-adapters/src/test/resources/schema.sql  |  6 +++---
 asdc-controller/src/test/resources/schema.sql                  |  6 +++---
 .../mso-api-handler-infra/src/test/resources/schema.sql        |  6 +++---
 mso-catalog-db/src/test/resources/schema.sql                   |  6 +++---
 5 files changed, 22 insertions(+), 12 deletions(-)
 create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.23__ChangeResourceInputLength.sql

(limited to 'adapters/mso-openstack-adapters/src/test/resources/schema.sql')

diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.23__ChangeResourceInputLength.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.23__ChangeResourceInputLength.sql
new file mode 100644
index 0000000000..dfb5075674
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.23__ChangeResourceInputLength.sql
@@ -0,0 +1,10 @@
+use catalogdb;
+
+ALTER TABLE vnf_resource_customization
+  MODIFY IF EXISTS RESOURCE_INPUT varchar(20000);
+
+ALTER TABLE network_resource_customization
+  MODIFY IF EXISTS RESOURCE_INPUT varchar(20000);
+
+ALTER TABLE allotted_resource_customization
+  MODIFY IF EXISTS RESOURCE_INPUT varchar(20000);
\ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index eff5c632fa..58083abba1 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -28,7 +28,7 @@ create table `allotted_resource_customization` (
   `min_instances` int(11) default null,
   `max_instances` int(11) default null,
   `ar_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   primary key (`model_customization_uuid`),
   key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -169,7 +169,7 @@ create table `network_resource_customization` (
   `network_scope` varchar(45) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   `network_resource_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
   constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -384,7 +384,7 @@ create table `vnf_resource_customization` (
   `creation_timestamp` datetime not null default current_timestamp,
   `vnf_resource_model_uuid` varchar(200) not null,
   `multi_stage_design` varchar(20) default null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
   constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index 58772c4998..020155be65 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -31,7 +31,7 @@ create table `allotted_resource_customization` (
   `min_instances` int(11) default null,
   `max_instances` int(11) default null,
   `ar_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   primary key (`model_customization_uuid`),
   key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -172,7 +172,7 @@ create table `network_resource_customization` (
   `network_scope` varchar(45) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   `network_resource_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
   constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -399,7 +399,7 @@ create table `vnf_resource_customization` (
   `creation_timestamp` datetime not null default current_timestamp,
   `vnf_resource_model_uuid` varchar(200) not null,
   `multi_stage_design` varchar(20) default null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
   constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
index e1719550b1..fe81fbcf92 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
@@ -30,7 +30,7 @@ create table `allotted_resource_customization` (
   `min_instances` int(11) default null,
   `max_instances` int(11) default null,
   `ar_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   primary key (`model_customization_uuid`),
   key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -171,7 +171,7 @@ create table `network_resource_customization` (
   `network_scope` varchar(45) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   `network_resource_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
   constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -398,7 +398,7 @@ create table `vnf_resource_customization` (
   `creation_timestamp` datetime not null default current_timestamp,
   `vnf_resource_model_uuid` varchar(200) not null,
   `multi_stage_design` varchar(20) default null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
   constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 9ee24d78ad..bd19c77e44 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -69,7 +69,7 @@ create table `allotted_resource_customization` (
   `min_instances` int(11) default null,
   `max_instances` int(11) default null,
   `ar_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   primary key (`model_customization_uuid`),
   key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -210,7 +210,7 @@ create table `network_resource_customization` (
   `network_scope` varchar(45) default null,
   `creation_timestamp` datetime not null default current_timestamp,
   `network_resource_model_uuid` varchar(200) not null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
   constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -437,7 +437,7 @@ create table `vnf_resource_customization` (
   `creation_timestamp` datetime not null default current_timestamp,
   `vnf_resource_model_uuid` varchar(200) not null,
   `multi_stage_design` varchar(20) default null,
-  `resource_input` varchar(2000) default null,
+  `resource_input` varchar(20000) default null,
   primary key (`model_customization_uuid`),
   key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
   constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
-- 
cgit 1.2.3-korg


From d5f5d0d06b7838d14b8776d8273a62ca3eb99355 Mon Sep 17 00:00:00 2001
From: subhash kumar singh <subhash.kumar.singh@huawei.com>
Date: Tue, 22 Jan 2019 12:56:29 +0530
Subject: Fix CSAR distribution on CCVPN service

Fix db schema to allow CCVPN service witout heat artifacts.

Change-Id: I4f79881a6a04f01f8984835eea88907a61c640db
Issue-ID: SO-1407
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
---
 .../db/migration/V4.24__UpdateHeatRelatedAttribute.sql        |  5 +++++
 adapters/mso-openstack-adapters/src/test/resources/schema.sql |  7 +++----
 asdc-controller/src/test/resources/schema.sql                 |  7 +++----
 .../mso-api-handler-infra/src/test/resources/schema.sql       |  7 +++----
 mso-catalog-db/src/test/resources/schema.sql                  | 11 +++++------
 5 files changed, 19 insertions(+), 18 deletions(-)
 create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.24__UpdateHeatRelatedAttribute.sql

(limited to 'adapters/mso-openstack-adapters/src/test/resources/schema.sql')

diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.24__UpdateHeatRelatedAttribute.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.24__UpdateHeatRelatedAttribute.sql
new file mode 100644
index 0000000000..b1aefaf56c
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.24__UpdateHeatRelatedAttribute.sql
@@ -0,0 +1,5 @@
+use catalogdb;
+
+ALTER TABLE network_resource MODIFY COLUMN AIC_VERSION_MIN varchar(20) NULL;
+ALTER TABLE network_resource MODIFY COLUMN HEAT_TEMPLATE_ARTIFACT_UUID varchar(200) NULL;
+ALTER TABLE network_resource DROP FOREIGN KEY fk_network_resource__temp_network_heat_template_lookup__mod_nm1;
\ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index 58083abba1..f0dfc16bd0 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -139,11 +139,11 @@ create table `network_resource` (
   `model_name` varchar(200) not null,
   `model_invariant_uuid` varchar(200) default null,
   `description` varchar(1200) default null,
-  `heat_template_artifact_uuid` varchar(200) not null,
+  `heat_template_artifact_uuid` varchar(200) null,
   `neutron_network_type` varchar(20) default null,
   `model_version` varchar(20) default null,
   `tosca_node_type` varchar(200) default null,
-  `aic_version_min` varchar(20) not null,
+  `aic_version_min` varchar(20) null,
   `aic_version_max` varchar(20) default null,
   `orchestration_mode` varchar(20) default 'heat',
   `resource_category` varchar(20) default null,
@@ -152,8 +152,7 @@ create table `network_resource` (
   primary key (`model_uuid`),
   key `fk_network_resource__temp_network_heat_template_lookup1_idx` (`model_name`),
   key `fk_network_resource__heat_template1_idx` (`heat_template_artifact_uuid`),
-  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade,
-  constraint `fk_network_resource__temp_network_heat_template_lookup__mod_nm1` foreign key (`model_name`) references `temp_network_heat_template_lookup` (`network_resource_model_name`) on delete no action on update no action
+  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade
 ) engine=innodb default charset=latin1;
 
 
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index 020155be65..9254780291 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -142,11 +142,11 @@ create table `network_resource` (
   `model_name` varchar(200) not null,
   `model_invariant_uuid` varchar(200) default null,
   `description` varchar(1200) default null,
-  `heat_template_artifact_uuid` varchar(200) not null,
+  `heat_template_artifact_uuid` varchar(200) null,
   `neutron_network_type` varchar(20) default null,
   `model_version` varchar(20) default null,
   `tosca_node_type` varchar(200) default null,
-  `aic_version_min` varchar(20) not null,
+  `aic_version_min` varchar(20) null,
   `aic_version_max` varchar(20) default null,
   `orchestration_mode` varchar(20) default 'heat',
   `resource_category` varchar(20) default null,
@@ -155,8 +155,7 @@ create table `network_resource` (
   primary key (`model_uuid`),
   key `fk_network_resource__temp_network_heat_template_lookup1_idx` (`model_name`),
   key `fk_network_resource__heat_template1_idx` (`heat_template_artifact_uuid`),
-  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade,
-  constraint `fk_network_resource__temp_network_heat_template_lookup__mod_nm1` foreign key (`model_name`) references `temp_network_heat_template_lookup` (`network_resource_model_name`) on delete no action on update no action
+  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade
 ) engine=innodb default charset=latin1;
 
 
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
index fe81fbcf92..98b26a4be2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
@@ -141,11 +141,11 @@ create table `network_resource` (
   `model_name` varchar(200) not null,
   `model_invariant_uuid` varchar(200) default null,
   `description` varchar(1200) default null,
-  `heat_template_artifact_uuid` varchar(200) not null,
+  `heat_template_artifact_uuid` varchar(200) null,
   `neutron_network_type` varchar(20) default null,
   `model_version` varchar(20) default null,
   `tosca_node_type` varchar(200) default null,
-  `aic_version_min` varchar(20) not null,
+  `aic_version_min` varchar(20) null,
   `aic_version_max` varchar(20) default null,
   `orchestration_mode` varchar(20) default 'heat',
   `resource_category` varchar(20) default null,
@@ -154,8 +154,7 @@ create table `network_resource` (
   primary key (`model_uuid`),
   key `fk_network_resource__temp_network_heat_template_lookup1_idx` (`model_name`),
   key `fk_network_resource__heat_template1_idx` (`heat_template_artifact_uuid`),
-  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade,
-  constraint `fk_network_resource__temp_network_heat_template_lookup__mod_nm1` foreign key (`model_name`) references `temp_network_heat_template_lookup` (`network_resource_model_name`) on delete no action on update no action
+  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade
 ) engine=innodb default charset=latin1;
 
 
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index bd19c77e44..221f0d8df6 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -165,8 +165,8 @@ create table `network_recipe` (
 
 create table `temp_network_heat_template_lookup` (
   `network_resource_model_name` varchar(200) not null,
-  `heat_template_artifact_uuid` varchar(200) not null,
-  `aic_version_min` varchar(20) not null,
+  `heat_template_artifact_uuid` varchar(200) null,
+  `aic_version_min` varchar(20) null,
   `aic_version_max` varchar(20) default null,
   primary key (`network_resource_model_name`),
   key `fk_temp_network_heat_template_lookup__heat_template1_idx` (`heat_template_artifact_uuid`),
@@ -180,11 +180,11 @@ create table `network_resource` (
   `model_name` varchar(200) not null,
   `model_invariant_uuid` varchar(200) default null,
   `description` varchar(1200) default null,
-  `heat_template_artifact_uuid` varchar(200) not null,
+  `heat_template_artifact_uuid` varchar(200) null,
   `neutron_network_type` varchar(20) default null,
   `model_version` varchar(20) default null,
   `tosca_node_type` varchar(200) default null,
-  `aic_version_min` varchar(20) not null,
+  `aic_version_min` varchar(20) null,
   `aic_version_max` varchar(20) default null,
   `orchestration_mode` varchar(20) default 'heat',
   `resource_category` varchar(20) default null,
@@ -193,8 +193,7 @@ create table `network_resource` (
   primary key (`model_uuid`),
   key `fk_network_resource__temp_network_heat_template_lookup1_idx` (`model_name`),
   key `fk_network_resource__heat_template1_idx` (`heat_template_artifact_uuid`),
-  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade,
-  constraint `fk_network_resource__temp_network_heat_template_lookup__mod_nm1` foreign key (`model_name`) references `temp_network_heat_template_lookup` (`network_resource_model_name`) on delete no action on update no action
+  constraint `fk_network_resource__heat_template1` foreign key (`heat_template_artifact_uuid`) references `heat_template` (`artifact_uuid`) on delete no action on update cascade
 ) engine=innodb default charset=latin1;
 
 
-- 
cgit 1.2.3-korg

