airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch airavata-2938-change-db-initialization-in-registry-server-to-use-registry-refactoring-code updated: AIRAVATA-2938 Migration to sync DB with DB init script: replica_catalog
Date Thu, 31 Jan 2019 15:45:05 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch airavata-2938-change-db-initialization-in-registry-server-to-use-registry-refactoring-code
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/airavata-2938-change-db-initialization-in-registry-server-to-use-registry-refactoring-code
by this push:
     new 33c4c87  AIRAVATA-2938 Migration to sync DB with DB init script: replica_catalog
33c4c87 is described below

commit 33c4c87b602eb4ebb8003288c5bd32d8c7d5c823
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Thu Jan 31 10:44:50 2019 -0500

    AIRAVATA-2938 Migration to sync DB with DB init script: replica_catalog
---
 .../src/main/resources/replicacatalog-derby.sql          | 13 +++++++------
 .../src/main/resources/replicacatalog-mysql.sql          |  3 ++-
 .../next/DeltaScripts/replicaCatalog_schema_delta.sql    | 16 ++++++++++++++++
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/modules/registry-refactoring/src/main/resources/replicacatalog-derby.sql b/modules/registry-refactoring/src/main/resources/replicacatalog-derby.sql
index e0f4950..ffd8055 100644
--- a/modules/registry-refactoring/src/main/resources/replicacatalog-derby.sql
+++ b/modules/registry-refactoring/src/main/resources/replicacatalog-derby.sql
@@ -25,14 +25,15 @@ CREATE TABLE DATA_PRODUCT
         PRODUCT_URI VARCHAR (255),
         GATEWAY_ID VARCHAR (255),
         PRODUCT_NAME VARCHAR (255),
-        PRODUCT_DESCRIPTION VARCHAR (1024),
-        PARENT_PRODUCT_URI VARCHAR (255),
+        PRODUCT_DESCRIPTION VARCHAR (255),
         OWNER_NAME VARCHAR (255),
+        PARENT_PRODUCT_URI VARCHAR (255),
         PRODUCT_SIZE INTEGER ,
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
         LAST_MODIFIED_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
         PRODUCT_TYPE VARCHAR(10),
-        PRIMARY KEY (PRODUCT_URI)
+        PRIMARY KEY (PRODUCT_URI),
+        FOREIGN KEY (PARENT_PRODUCT_URI) REFERENCES DATA_PRODUCT (PRODUCT_URI) ON DELETE
CASCADE
 );
 
 CREATE TABLE DATA_REPLICA_LOCATION
@@ -40,7 +41,7 @@ CREATE TABLE DATA_REPLICA_LOCATION
         REPLICA_ID VARCHAR (255),
         PRODUCT_URI VARCHAR (255) NOT NULL,
         REPLICA_NAME VARCHAR (255),
-        REPLICA_DESCRIPTION VARCHAR (1024),
+        REPLICA_DESCRIPTION VARCHAR (255),
         STORAGE_RESOURCE_ID VARCHAR (255),
         FILE_PATH VARCHAR (4096),
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
@@ -56,7 +57,7 @@ CREATE TABLE DATA_PRODUCT_METADATA
 (
         PRODUCT_URI VARCHAR(255) NOT NULL,
         METADATA_KEY VARCHAR(255),
-        METADATA_VALUE VARCHAR(2048),
+        METADATA_VALUE VARCHAR(255),
         PRIMARY KEY(PRODUCT_URI, METADATA_KEY),
         FOREIGN KEY (PRODUCT_URI) REFERENCES DATA_PRODUCT(PRODUCT_URI) ON DELETE CASCADE
 );
@@ -65,7 +66,7 @@ CREATE TABLE DATA_REPLICA_METADATA
 (
         REPLICA_ID VARCHAR(255) NOT NULL,
         METADATA_KEY VARCHAR(255),
-        METADATA_VALUE VARCHAR(2048),
+        METADATA_VALUE VARCHAR(255),
         PRIMARY KEY(REPLICA_ID, METADATA_KEY),
         FOREIGN KEY (REPLICA_ID) REFERENCES DATA_REPLICA_LOCATION(REPLICA_ID) ON DELETE CASCADE
 );
diff --git a/modules/registry-refactoring/src/main/resources/replicacatalog-mysql.sql b/modules/registry-refactoring/src/main/resources/replicacatalog-mysql.sql
index ec9a720..63148b5 100644
--- a/modules/registry-refactoring/src/main/resources/replicacatalog-mysql.sql
+++ b/modules/registry-refactoring/src/main/resources/replicacatalog-mysql.sql
@@ -32,7 +32,8 @@ CREATE TABLE DATA_PRODUCT
         CREATION_TIME TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
         LAST_MODIFIED_TIME TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
         PRODUCT_TYPE VARCHAR(10),
-        PRIMARY KEY (PRODUCT_URI)
+        PRIMARY KEY (PRODUCT_URI),
+        FOREIGN KEY (PARENT_PRODUCT_URI) REFERENCES DATA_PRODUCT (PRODUCT_URI) ON DELETE
CASCADE
 )ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 CREATE TABLE DATA_REPLICA_LOCATION
diff --git a/modules/registry/release-migration-scripts/next/DeltaScripts/replicaCatalog_schema_delta.sql
b/modules/registry/release-migration-scripts/next/DeltaScripts/replicaCatalog_schema_delta.sql
index 0be8971..1dd8aa6 100644
--- a/modules/registry/release-migration-scripts/next/DeltaScripts/replicaCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/next/DeltaScripts/replicaCatalog_schema_delta.sql
@@ -23,3 +23,19 @@ set FOREIGN_KEY_CHECKS=0;
 alter table DATA_PRODUCT_METADATA modify column PRODUCT_URI VARCHAR(255) NOT NULL;
 alter table DATA_REPLICA_METADATA modify column REPLICA_ID VARCHAR(255) NOT NULL;
 set FOREIGN_KEY_CHECKS=1;
+
+-- AIRAVATA-2938: bring database schema into sync with registry-refactoring DB init scripts
+-- somehow these workflow tables got created in the replica_catalog schema
+DROP TABLE IF EXISTS `PORT`;
+DROP TABLE IF EXISTS `WORKFLOW`;
+DROP TABLE IF EXISTS `WORKFLOW_OUTPUT`;
+DROP TABLE IF EXISTS `WORKFLOW_STATUS`;
+DROP TABLE IF EXISTS `NODE`;
+DROP TABLE IF EXISTS `WORKFLOW_INPUT`;
+DROP TABLE IF EXISTS `COMPONENT_STATUS`;
+DROP TABLE IF EXISTS `EDGE`;
+set FOREIGN_KEY_CHECKS=0;
+ALTER TABLE `DATA_PRODUCT` CHANGE `PRODUCT_TYPE` `PRODUCT_TYPE` varchar(10) DEFAULT NULL;
+ALTER TABLE `DATA_REPLICA_LOCATION` CHANGE `REPLICA_LOCATION_CATEGORY` `REPLICA_LOCATION_CATEGORY`
varchar(26) DEFAULT NULL;
+ALTER TABLE `DATA_REPLICA_LOCATION` CHANGE `REPLICA_PERSISTENT_TYPE` `REPLICA_PERSISTENT_TYPE`
varchar(10) DEFAULT NULL;
+set FOREIGN_KEY_CHECKS=1;


Mime
View raw message