cr-connect-workflow/migrations/versions/afecb64d2e66_.py

37 lines
1.3 KiB
Python
Raw Normal View History

2020-03-27 16:19:32 +00:00
"""empty message
Revision ID: afecb64d2e66
Revises: 5e0709e172fa
Create Date: 2020-03-27 12:18:54.378797
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'afecb64d2e66'
down_revision = '5e0709e172fa'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('study_status_spec_id_fkey', 'study', type_='foreignkey')
op.drop_column('study', 'status_spec_version')
op.drop_column('study', 'status_spec_id')
op.add_column('workflow_spec', sa.Column('is_master_spec', sa.Boolean(), nullable=True))
op.drop_column('workflow_spec', 'is_status')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('workflow_spec', sa.Column('is_status', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.drop_column('workflow_spec', 'is_master_spec')
op.add_column('study', sa.Column('status_spec_id', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('study', sa.Column('status_spec_version', sa.VARCHAR(), autoincrement=False, nullable=True))
op.create_foreign_key('study_status_spec_id_fkey', 'study', 'workflow_spec', ['status_spec_id'], ['id'])
# ### end Alembic commands ###