This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/staging by this push:
new bac4835 Adding PK, FK to PROCESS_WORKFLOW
bac4835 is described below
commit bac48350bb1a22f684e11740d17a5ed66f37c8aa
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Fri Jan 25 15:52:51 2019 -0500
Adding PK, FK to PROCESS_WORKFLOW
---
.../registry/registry-core/src/main/resources/expcatalog-derby.sql | 6 ++++--
.../registry/registry-core/src/main/resources/expcatalog-mysql.sql | 6 ++++--
.../0.16-0.17/DeltaScripts/expCatalog_schema_delta.sql | 6 ++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index 8e2f1be..8ad0d33 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -401,5 +401,7 @@ CREATE TABLE PROCESS_WORKFLOW
PROCESS_ID varchar(255) NOT NULL,
WORKFLOW_ID varchar(255) NOT NULL,
TYPE varchar(255) DEFAULT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-);
\ No newline at end of file
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (PROCESS_ID, WORKFLOW_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
+);
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index 0ed247b..f05ef17 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -404,5 +404,7 @@ CREATE TABLE PROCESS_WORKFLOW
PROCESS_ID varchar(255) NOT NULL,
WORKFLOW_ID varchar(255) NOT NULL,
TYPE varchar(255) DEFAULT NULL,
- CREATION_TIME timestamp DEFAULT NOW()
-);
\ No newline at end of file
+ CREATION_TIME timestamp DEFAULT NOW(),
+ PRIMARY KEY (PROCESS_ID, WORKFLOW_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
+);
diff --git a/modules/registry/release-migration-scripts/0.16-0.17/DeltaScripts/expCatalog_schema_delta.sql
b/modules/registry/release-migration-scripts/0.16-0.17/DeltaScripts/expCatalog_schema_delta.sql
index 636c8fa..a802e8d 100644
--- a/modules/registry/release-migration-scripts/0.16-0.17/DeltaScripts/expCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/0.16-0.17/DeltaScripts/expCatalog_schema_delta.sql
@@ -50,8 +50,10 @@ CREATE TABLE PROCESS_WORKFLOW
PROCESS_ID varchar(255) NOT NULL,
WORKFLOW_ID varchar(255) NOT NULL,
TYPE varchar(255) DEFAULT NULL,
- CREATION_TIME timestamp DEFAULT NOW()
+ CREATION_TIME timestamp DEFAULT NOW(),
+ PRIMARY KEY (PROCESS_ID, WORKFLOW_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `TASK` ADD `MAX_RETRY` int(11) NOT NULL DEFAULT '3';
-ALTER TABLE `TASK` ADD `CURRENT_RETRY` int(11) NOT NULL DEFAULT '0';
\ No newline at end of file
+ALTER TABLE `TASK` ADD `CURRENT_RETRY` int(11) NOT NULL DEFAULT '0';
|