forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration for tool request implicit collections.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...alaxy/model/migrations/alembic/versions_gxy/1d1d7bf6ac02_tool_request_implicit_outputs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"""Track tool request implicit output collections. | ||
Revision ID: 1d1d7bf6ac02 | ||
Revises: a99a5b52ccb8 | ||
Create Date: 2024-11-18 15:39:42.900327 | ||
""" | ||
import sqlalchemy as sa | ||
from sqlalchemy import ( | ||
Column, | ||
) | ||
|
||
from galaxy.model.migrations.util import ( | ||
add_column, | ||
column_exists, | ||
drop_column, | ||
transaction, | ||
) | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1d1d7bf6ac02' | ||
down_revision = 'a99a5b52ccb8' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
association_table_name = "ToolRequestImplicitCollectionAssociation" | ||
|
||
|
||
def upgrade(): | ||
with transaction(): | ||
create_table( | ||
association_table_name, | ||
Column("id", Integer, primary_key=True), | ||
Column("tool_request_id", Integer, index=True), | ||
Column("dataset_collection_id", Integer, index=True), | ||
Column("output_name", String(255), nullable=False), | ||
) | ||
|
||
create_foreign_key( | ||
"fk_trica_tri", | ||
association_table_name, | ||
"tool_request", | ||
["tool_request_id"], | ||
["id"], | ||
) | ||
|
||
create_foreign_key( | ||
"fk_trica_dci", | ||
association_table_name, | ||
"history_dataset_collection_association", | ||
["dataset_collection_id"], | ||
["id"], | ||
) | ||
|
||
|
||
def downgrade(): | ||
drop_table(association_table_name) |