Skip to content

Commit

Permalink
Merge pull request #13541 from ic4f/dev_13376_migration
Browse files Browse the repository at this point in the history
Add source_metadata column to workflow table as alembic revision
  • Loading branch information
jdavcs authored Mar 16, 2022
2 parents 4b3c948 + 7725491 commit 41d7cf2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""add workflow.source_metadata column
Revision ID: b182f655505f
Revises: e7b6dcb09efd
Create Date: 2022-03-14 12:56:57.067748
"""
from alembic import op
from sqlalchemy import Column

from galaxy.model.custom_types import JSONType
from galaxy.model.migrations.util import drop_column

# revision identifiers, used by Alembic.
revision = "b182f655505f"
down_revision = "e7b6dcb09efd"
branch_labels = None
depends_on = None


def upgrade():
op.add_column("workflow", Column("source_metadata", JSONType))


def downgrade():
drop_column("workflow", "source_metadata")
6 changes: 6 additions & 0 deletions lib/galaxy/model/migrations/util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from alembic import op


def drop_column(table, column):
with op.batch_alter_table(table) as batch_op:
batch_op.drop_column(column)

0 comments on commit 41d7cf2

Please sign in to comment.