summaryrefslogtreecommitdiffstats
path: root/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files')
-rw-r--r--kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_add_constraints.sql45
-rw-r--r--[-rwxr-xr-x]kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql5
-rw-r--r--[-rwxr-xr-x]kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql0
3 files changed, 50 insertions, 0 deletions
diff --git a/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_add_constraints.sql b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_add_constraints.sql
new file mode 100644
index 0000000000..a5e9834de2
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_add_constraints.sql
@@ -0,0 +1,45 @@
+USE `mso_catalog`;
+
+ALTER TABLE `mso_catalog`.`service_to_allotted_resources`
+ ADD INDEX `fk_service_to_allotted_resources__service_model_uuid_idx` (`SERVICE_MODEL_UUID` ASC),
+ ADD INDEX `fk_service_to_allotted_resources__allotted_resource_customiz_idx` (`AR_MODEL_CUSTOMIZATION_UUID` ASC),
+ ADD CONSTRAINT `fk_service_to_allotted_resources__service__service_name_ver_id`
+ FOREIGN KEY (`SERVICE_MODEL_UUID`)
+ REFERENCES `mso_catalog`.`service` (`SERVICE_NAME_VERSION_ID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE,
+ ADD CONSTRAINT `fk_service_to_allotted_resources__allotted_resource_customizat1`
+ FOREIGN KEY (`AR_MODEL_CUSTOMIZATION_UUID`)
+ REFERENCES `mso_catalog`.`allotted_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE;
+
+
+ALTER TABLE `mso_catalog`.`service_to_networks`
+ ADD INDEX `fk_service_to_networks__service_model_uuid_idx` (`SERVICE_MODEL_UUID` ASC),
+ ADD INDEX `fk_service_to_networks__network_resource_customization1_idx` (`NETWORK_MODEL_CUSTOMIZATION_UUID` ASC),
+ ADD CONSTRAINT `fk_service_to_networks__service__service_name_version_id`
+ FOREIGN KEY (`SERVICE_MODEL_UUID`)
+ REFERENCES `mso_catalog`.`service` (`SERVICE_NAME_VERSION_ID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE,
+ ADD CONSTRAINT `fk_service_to_networks__network_resource_customization1`
+ FOREIGN KEY (`NETWORK_MODEL_CUSTOMIZATION_UUID`)
+ REFERENCES `mso_catalog`.`network_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE;
+
+
+ALTER TABLE `mso_catalog`.`vf_module`
+ ADD INDEX `UK_model_customization_uuid__asdc_service_model_version` (`MODEL_CUSTOMIZATION_UUID` ASC, `ASDC_SERVICE_MODEL_VERSION` ASC);
+
+ALTER TABLE `mso_catalog`.`vnf_resource`
+ ADD UNIQUE INDEX `UK_model_customization_uuid__asdc_service_model_version` (`MODEL_CUSTOMIZATION_UUID` ASC, `ASDC_SERVICE_MODEL_VERSION` ASC);
+
+ALTER TABLE `mso_catalog`.`network_resource_customization`
+ ADD INDEX `fk_network_resource_customization__network_resource_id_idx` (`NETWORK_RESOURCE_ID` ASC),
+ ADD CONSTRAINT `fk_network_resource_customization__network_resource__id`
+ FOREIGN KEY (`NETWORK_RESOURCE_ID`)
+ REFERENCES `mso_catalog`.`network_resource` (`id`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE; \ No newline at end of file
diff --git a/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql
index 12d5d8c112..bc88adcc70 100755..100644
--- a/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql
+++ b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql
@@ -12,3 +12,8 @@ ALTER TABLE HEAT_FILES MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT
ALTER TABLE HEAT_TEMPLATE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL;
ALTER TABLE VF_MODULE MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
ALTER TABLE SERVICE_RECIPE MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
+ALTER TABLE NETWORK_RESOURCE_CUSTOMIZATION MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
+ALTER TABLE ALLOTTED_RESOURCE_CUSTOMIZATION MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
+ALTER TABLE SERVICE_TO_ALLOTTED_RESOURCES MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
+ALTER TABLE SERVICE_TO_NETWORKS MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP NOT NULL;
+
diff --git a/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql
index 3b2de4c0b7..3b2de4c0b7 100755..100644
--- a/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql
+++ b/kubernetes/config/docker/init/src/config/mso/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql