From daf17e660a2ae467a3c85c0c89a87e2c87b40108 Mon Sep 17 00:00:00 2001 From: steve-fischer-200 Date: Tue, 27 Feb 2024 20:21:58 -0500 Subject: [PATCH 1/2] initial draft --- .../apidbschema/Oracle/createWorkflowVdi.sql | 48 +++++++++++++++++++ .../apidbschema/Oracle/dropWorkflowVdi.sql | 5 ++ 2 files changed, 53 insertions(+) create mode 100644 Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql create mode 100644 Main/lib/sql/apidbschema/Oracle/dropWorkflowVdi.sql diff --git a/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql b/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql new file mode 100644 index 0000000..8cae9d4 --- /dev/null +++ b/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql @@ -0,0 +1,48 @@ + +-- Track the relationship between a workflow's artifact and its VDI ID +create table apidb.WorkflowArtifactVdiId ( + workflow_id number(10) NOT NULL, + organism_abbrev varchar(20), -- nullable for, eg, the global workflow + artifact_name varchar(500) NOT NULL, + vdi_id varchar2(32) NOT NULL, + PRIMARY KEY (workflow_id, organism_abbrev, artifact_name), + UNIQUE (vdi_id) +); + +GRANT INSERT, SELECT, UPDATE, DELETE ON apidb.WorkflowArtifactVdiId TO gus_w; +GRANT SELECT ON apidb.WorkflowArtifactVdiId TO gus_r; + +---------------------------------------------------------------------------- + +-- Capture the time boundaries of the most recent batch of tuning tables submitted to VDI for a given data source +create table apidb.WorkflowTuningTableBatch ( + workflow_id number(10) NOT NULL, + organism_abbrev varchar(20), -- nullable for eg global workflow + start_timestamp DATE NOT NULL, -- time from apidb.tuningtable + end_timestamp DATE NOT NULL, -- time from apidb.tuningtable + is_complete number(1) -- =1 if complete + PRIMARY KEY (workflow_id, organism_abbrev) +); + +GRANT INSERT, SELECT, UPDATE, DELETE ON apidb.WorkflowTuningTableBatch TO gus_w; +GRANT SELECT ON apidb.WorkflowTuningTableBatch TO gus_r; + +---------------------------------------------------------------------------- + +-- Track the status of workflow artifacts submitted to VDI. See the VDI API for expected status values. +create table apidb.WorkflowVdiStatus ( + vdi_id varchar2(32) NOT NULL, + modification_time DATE NOT NULL, -- last status update + vdi_import_status varchar(30), + vdi_install_status varchar(30), + vdi_meta_status varchar(30), + vdi_delete_status varchar(30), + vdi_error_message varchar(500) -- error message for most recent failure. Only track one. + PRIMARY KEY (vdi_id) +); + +GRANT INSERT, SELECT, UPDATE, DELETE ON apidb.WorkflowVdiStatus TO gus_w; +GRANT SELECT ON apidb.WorkflowVdiStatus TO gus_r; + + +exit; diff --git a/Main/lib/sql/apidbschema/Oracle/dropWorkflowVdi.sql b/Main/lib/sql/apidbschema/Oracle/dropWorkflowVdi.sql new file mode 100644 index 0000000..063d5fc --- /dev/null +++ b/Main/lib/sql/apidbschema/Oracle/dropWorkflowVdi.sql @@ -0,0 +1,5 @@ +drop table ApiDB.WorkflowArtifactVdiId; +drop table ApiDB.WorkflowTuningTableBatch; +drop table ApiDB.WorkflowVdiStatus; + +exit; From 80e9741d25ae6f965b8b58529687cb8d8e2ffb1e Mon Sep 17 00:00:00 2001 From: Steve <43149795+steve-fischer-200@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:32:20 -0500 Subject: [PATCH 2/2] Update createWorkflowVdi.sql --- Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql b/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql index 8cae9d4..777b203 100644 --- a/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql +++ b/Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql @@ -15,7 +15,7 @@ GRANT SELECT ON apidb.WorkflowArtifactVdiId TO gus_r; ---------------------------------------------------------------------------- -- Capture the time boundaries of the most recent batch of tuning tables submitted to VDI for a given data source -create table apidb.WorkflowTuningTableBatch ( +create table apidb.WorkflowVdiTuningTableBatch ( workflow_id number(10) NOT NULL, organism_abbrev varchar(20), -- nullable for eg global workflow start_timestamp DATE NOT NULL, -- time from apidb.tuningtable