Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
b3293fce
Commit
b3293fce
authored
4 years ago
by
Daniel Lyons
Browse files
Options
Downloads
Patches
Plain Diff
Add remaining tables for workflows
parent
aca33223
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
schema/versions/44d5bbbf2615_workspaces_init.py
+20
-49
20 additions, 49 deletions
schema/versions/44d5bbbf2615_workspaces_init.py
with
20 additions
and
49 deletions
schema/versions/44d5bbbf2615_workspaces_init.py
+
20
−
49
View file @
b3293fce
...
...
@@ -8,8 +8,6 @@ Create Date: 2020-09-02 11:25:01.571392
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'
44d5bbbf2615
'
down_revision
=
None
branch_labels
=
None
...
...
@@ -23,54 +21,27 @@ def upgrade():
sa
.
Column
(
'
name
'
,
sa
.
String
,
unique
=
True
,
comment
=
'
a human-readable name for the workflow.
'
),
comment
=
'
A listing of the available workflows in the system.
'
)
"""
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.
'
;
"""
op
.
create_table
(
'
workflow_requests
'
,
sa
.
Column
(
'
workflow_request_id
'
,
sa
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
,
comment
=
'
the unique id of the request. auto-generated
'
),
sa
.
Column
(
'
job_id
'
,
sa
.
Integer
,
comment
=
'
the id of the job that this request generted in the HTCondor system.
'
),
sa
.
Column
(
'
workflow_id
'
,
sa
.
Integer
,
sa
.
ForeignKey
(
'
workflows.workflow_id
'
),
comment
=
'
the id of the workflow used in this request.
'
),
sa
.
Column
(
'
argument
'
,
sa
.
JSON
,
comment
=
'
the argument(s) used for the workflow in this request.
'
),
comment
=
'
A listing of requests for workflows and te resulting job ids.
'
)
op
.
create_table
(
'
workflow_request_files
'
,
sa
.
Column
(
'
workflow_request_id
'
,
sa
.
Integer
,
sa
.
ForeignKey
(
'
workflow_requests.workflow_request_id
'
),
comment
=
'
the id of the workflow request.
'
),
sa
.
Column
(
'
filename
'
,
sa
.
String
,
comment
=
'
the name of this file
'
,
nullable
=
False
),
sa
.
Column
(
'
content
'
,
sa
.
String
,
comment
=
'
the contents of the file
'
,
nullable
=
False
),
comment
=
'
A man-to-many mapping table tracking which files were used for workflow requests.
'
)
op
.
create_unique_constraint
(
'
workflow_request_filenames_uniq
'
,
'
workflow_request_files
'
,
[
'
workflow_request_id
'
,
'
filename
'
])
def
downgrade
():
op
.
drop_table
(
'
workflow_request_files
'
)
op
.
drop_table
(
'
workflow_requests
'
)
op
.
drop_table
(
'
workflows
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment