diff --git a/schema/create_ws_tables.sql b/schema/create_ws_tables.sql new file mode 100644 index 0000000000000000000000000000000000000000..c9285d55af81eafae2960c45a2310b835fd76491 --- /dev/null +++ b/schema/create_ws_tables.sql @@ -0,0 +1,53 @@ +create table workflows ( + workflow_id serial primary key , + name varchar +); +comment on table workflows is 'A listing of the available workflows in the system. '; +comment on column workflows.workflow_id is 'the unique id of the workflow. auto-generated.'; +comment on column workflows.name is 'a human-readable name for the workflow.'; + +create table workflow_requests ( + workflow_request_id serial primary key , + job_id int, + workflow_id int references workflows(workflow_id), + argument json +); +comment on table workflow_requests is 'A listing of requests for workflows and te resulting job ids.'; +comment on column workflow_requests.workflow_request_id is 'the unique id of the request. auto-generated'; +comment on column workflow_requests.job_id is 'the id of the job that this request generted in the ? system.'; +comment on column workflow_requests.workflow_id is 'the id of the workflow used in this request.'; +comment on column workflow_requests.argument is 'the argument(s) used for the workflow in this request.'; + +create table workflow_request_files ( + workflow_request_id int references workflow_requests(workflow_request_id), + file_id int references files(file_id), + primary key (workflow_request_id, file_id) +); +comment on table workflow_request_files is 'A man-to-many mapping table tracking which files were used for workflow requests.'; +comment on column workflow_request_files.workflow_request_id is 'the id of the workflow request.'; +comment on column workflow_request_files.file_id is 'the id of the file referenced by the workflow request.'; + +create table capabilities ( + capability_id serial primary key , + name varchar not null , + template_files varchar, + steps varchar not null +); +comment on table capabilities is 'A listing of the available capabilities in the system.'; +comment on column capabilities.capability_id is 'the unique id of the capability. auto-generated.'; +comment on column capabilities.name is 'the human-readable name of the capability.'; +comment on column capabilities.template_files is '?'; +comment on column capabilities.steps is 'the unique id of the capability. auto-generated.'; + +create table capability_requests ( + capability_request_id serial primary key , + capability_id int references capabilities(capability_id), + user_id int not null , + argument json +); + +comment on table capability_requests is 'A listing of requests for capabilities, with the id of the requesting user.'; +comment on column capability_requests.capability_request_id is 'The unique id of the request. auto-generated.'; +comment on column capability_requests.capability_id is 'the id of the capability being requested.'; +comment on column capability_requests.user_id is 'the id of the user requesting the capability.'; +comment on column capability_requests.argument is 'the JSON holding the details of the request.'; \ No newline at end of file