diff options
Diffstat (limited to 'volumes/mariadb')
5 files changed, 25 insertions, 56 deletions
diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql index b42675b..880dbf1 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql +++ b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql @@ -16,7 +16,6 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mso_requests` /*!40100 DEFAULT CHARACT USE `mso_requests`; SOURCE ../../main-schemas/MySQL-Requests-schema.sql -SOURCE ../../sub-sql-files/site_status_updated_timestamp.sql -- -- Current Database: `mso_catalog` @@ -29,7 +28,6 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mso_catalog` /*!40100 DEFAULT CHARACTE USE `mso_catalog`; SOURCE ../../main-schemas/MySQL-Catalog-schema.sql -SOURCE ../../sub-sql-files/catalog_timestamp_mso_db.sql SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Catalog-schema.sql b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Catalog-schema.sql index 836b3f9..a6a7dc5 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Catalog-schema.sql +++ b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Catalog-schema.sql @@ -91,7 +91,7 @@ TOSCA_NODE_TYPE varchar(255), SUBCATEGORY varchar(255), DESCRIPTION varchar(255), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_UUID) ); @@ -107,7 +107,7 @@ NF_NAMING_CODE varchar(255), MIN_INSTANCES integer, MAX_INSTANCES integer, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_CUSTOMIZATION_UUID) ); @@ -117,7 +117,7 @@ VERSION varchar(20) not null, DESCRIPTION varchar(1200), BODY longtext not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, ARTIFACT_CHECKSUM varchar(200) default 'MANUAL RECORD', primary key (ARTIFACT_UUID) ); @@ -128,7 +128,7 @@ NAME varchar(255), VERSION varchar(255), BODY varchar(255), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, ARTIFACT_CHECKSUM varchar(255), primary key (ARTIFACT_UUID) ); @@ -147,7 +147,7 @@ BODY longtext not null, TIMEOUT_MINUTES integer, DESCRIPTION varchar(1200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, ARTIFACT_CHECKSUM varchar(200) default 'MANUAL RECORD' not null, primary key (ARTIFACT_UUID) ); @@ -170,7 +170,7 @@ MODEL_VERSION varchar(20), MODEL_CUSTOMIZATION_ID varchar(40), MODEL_CUSTOMIZATION_NAME varchar(40), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (id) ); @@ -183,7 +183,7 @@ ORCHESTRATION_URI varchar(256) not null, MODEL_PARAM_XSD varchar(2048), RECIPE_TIMEOUT integer, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (id) ); @@ -197,7 +197,7 @@ ORCHESTRATION_URI varchar(256) not null, NETWORK_PARAM_XSD varchar(2048), RECIPE_TIMEOUT integer, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (id) ); @@ -213,7 +213,7 @@ HEAT_TEMPLATE_ARTIFACT_UUID varchar(200) not null, AIC_VERSION_MIN varchar(20) default 2.5 not null, AIC_VERSION_MAX varchar(20) default 2.5, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_UUID) ); @@ -225,7 +225,7 @@ NETWORK_TYPE varchar(255), NETWORK_SCOPE varchar(255), NETWORK_ROLE varchar(255), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_CUSTOMIZATION_UUID) ); @@ -235,7 +235,7 @@ MODEL_VERSION varchar(20) not null, DESCRIPTION varchar(1200), TOSCA_CSAR_ARTIFACT_UUID varchar(200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, MODEL_INVARIANT_UUID varchar(200) default 'MANUAL_RECORD' not null, SERVICE_TYPE varchar(20), SERVICE_ROLE varchar(20), @@ -247,7 +247,7 @@ SERVICE_MODEL_UUID varchar(200) not null, ACTION varchar(40) not null, ORCHESTRATION_URI varchar(256) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, VERSION_STR varchar(20), DESCRIPTION varchar(1200), SERVICE_PARAM_XSD varchar(2048), @@ -259,21 +259,21 @@ create table SERVICE_TO_ALLOTTED_RESOURCES ( SERVICE_MODEL_UUID varchar(200) not null, AR_MODEL_CUSTOMIZATION_UUID varchar(200) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (SERVICE_MODEL_UUID, AR_MODEL_CUSTOMIZATION_UUID) ); create table SERVICE_TO_NETWORKS ( SERVICE_MODEL_UUID varchar(200) not null, NETWORK_MODEL_CUSTOMIZATION_UUID varchar(200) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (SERVICE_MODEL_UUID, NETWORK_MODEL_CUSTOMIZATION_UUID) ); create table SERVICE_TO_RESOURCE_CUSTOMIZATIONS ( MODEL_TYPE varchar(20) not null, RESOURCE_MODEL_CUSTOMIZATION_UUID varchar(200) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, SERVICE_MODEL_UUID varchar(200) not null, primary key (MODEL_TYPE, RESOURCE_MODEL_CUSTOMIZATION_UUID) ); @@ -293,7 +293,7 @@ ARTIFACT_CHECKSUM varchar(200) not null, URL varchar(200) not null, DESCRIPTION varchar(1200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (ARTIFACT_UUID) ); @@ -307,7 +307,7 @@ IS_BASE integer not null, HEAT_TEMPLATE_ARTIFACT_UUID varchar(200) not null, VOL_HEAT_TEMPLATE_ARTIFACT_UUID varchar(200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_UUID) ); @@ -315,7 +315,7 @@ MODEL_CUSTOMIZATION_UUID varchar(200) not null, VF_MODULE_MODEL_UUID varchar(200) not null, VOL_ENVIRONMENT_ARTIFACT_UUID varchar(200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, HEAT_ENVIRONMENT_ARTIFACT_UUID varchar(200), MIN_INSTANCES integer, MAX_INSTANCES integer, @@ -336,7 +336,7 @@ COMPONENT_TYPE varchar(20) not null, HEAT_TEMPLATE_ID integer, HEAT_ENVIRONMENT_ID integer, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (VNF_ID, COMPONENT_TYPE) ); @@ -352,7 +352,7 @@ ORCHESTRATION_URI varchar(256) not null, VNF_COMPONENT_PARAM_XSD varchar(2048), RECIPE_TIMEOUT integer, - CREATION_TIMESTAMP datetime, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (id) ); @@ -367,7 +367,7 @@ ORCHESTRATION_URI varchar(256) not null, VNF_PARAM_XSD varchar(2048), RECIPE_TIMEOUT integer, - CREATION_TIMESTAMP datetime, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (id) ); @@ -382,7 +382,7 @@ AIC_VERSION_MIN varchar(20), AIC_VERSION_MAX varchar(20), HEAT_TEMPLATE_ARTIFACT_UUID varchar(200), - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_UUID) ); @@ -397,14 +397,14 @@ NF_ROLE varchar(200), NF_NAMING_CODE varchar(200), VNF_RESOURCE_MODEL_UUID varchar(200) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (MODEL_CUSTOMIZATION_UUID) ); create table VNF_RES_CUSTOM_TO_VF_MODULE_CUSTOM ( VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID varchar(200) not null, VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID varchar(200) not null, - CREATION_TIMESTAMP datetime not null, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID, VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID) ); diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql index c6f070d..83f0b08 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql +++ b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/MySQL-Requests-schema.sql @@ -50,7 +50,7 @@ create table SITE_STATUS ( SITE_NAME varchar(255) not null, STATUS bit, - CREATION_TIMESTAMP datetime, + CREATION_TIMESTAMP datetime default CURRENT_TIMESTAMP, primary key (SITE_NAME) ); diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql deleted file mode 100644 index cf2ce7f..0000000 --- a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/catalog_timestamp_mso_db.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE `mso_catalog`; - -# Add DEFAULT value for CREATION_TIMESTAMP columns - -ALTER TABLE ALLOTTED_RESOURCE 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 HEAT_ENVIRONMENT MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE HEAT_FILES MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE HEAT_TEMPLATE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE MODEL MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE MODEL_RECIPE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE NETWORK_RECIPE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE NETWORK_RESOURCE 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 SERVICE 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 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; -ALTER TABLE SERVICE_TO_RESOURCE_CUSTOMIZATIONS MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE TOSCA_CSAR 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 VF_MODULE_CUSTOMIZATION MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_COMPONENTS MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_COMPONENTS_RECIPE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_RECIPE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_RESOURCE MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_RESOURCE_CUSTOMIZATION MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; -ALTER TABLE VNF_RES_CUSTOM_TO_VF_MODULE_CUSTOM MODIFY COLUMN CREATION_TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL; diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql b/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql deleted file mode 100644 index 3b2de4c..0000000 --- a/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/sub-sql-files/site_status_updated_timestamp.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE SITE_STATUS MODIFY COLUMN CREATION_TIMESTAMP datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; |