Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new create and drop scripts for VDI workflow tables #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Main/lib/sql/apidbschema/Oracle/createWorkflowVdi.sql
Original file line number Diff line number Diff line change
@@ -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.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
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;
5 changes: 5 additions & 0 deletions Main/lib/sql/apidbschema/Oracle/dropWorkflowVdi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
drop table ApiDB.WorkflowArtifactVdiId;
drop table ApiDB.WorkflowTuningTableBatch;
drop table ApiDB.WorkflowVdiStatus;

exit;