Skip to content

Commit

Permalink
Migration for tool request implicit collections.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 27, 2024
1 parent eed5f2f commit 2b11292
Showing 1 changed file with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""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,
Integer,
String,
)

from galaxy.model.migrations.util import (
create_foreign_key,
create_table,
drop_table,
transaction,
)


# revision identifiers, used by Alembic.
revision = '1d1d7bf6ac02'
down_revision = 'cbc46035eba0'
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)

0 comments on commit 2b11292

Please sign in to comment.