-
Notifications
You must be signed in to change notification settings - Fork 999
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13541 from ic4f/dev_13376_migration
Add source_metadata column to workflow table as alembic revision
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...model/migrations/alembic/versions_gxy/b182f655505f_add_workflow_source_metadata_column.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,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") |
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,6 @@ | ||
from alembic import op | ||
|
||
|
||
def drop_column(table, column): | ||
with op.batch_alter_table(table) as batch_op: | ||
batch_op.drop_column(column) |