cr-connect-workflow/migrations/versions/87af86338630_.py

39 lines
1.5 KiB
Python

"""empty message
Revision ID: 87af86338630
Revises: afecb64d2e66
Create Date: 2020-03-30 08:34:41.323688
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '87af86338630'
down_revision = 'afecb64d2e66'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('workflow', sa.Column('completed_tasks', sa.Integer(), nullable=True))
op.add_column('workflow', sa.Column('total_tasks', sa.Integer(), nullable=True))
op.add_column('workflow_spec', sa.Column('category_id', sa.Integer(), nullable=True))
op.drop_constraint('workflow_spec_workflow_spec_category_id_fkey', 'workflow_spec', type_='foreignkey')
op.create_foreign_key(None, 'workflow_spec', 'workflow_spec_category', ['category_id'], ['id'])
op.drop_column('workflow_spec', 'workflow_spec_category_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('workflow_spec', sa.Column('workflow_spec_category_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'workflow_spec', type_='foreignkey')
op.create_foreign_key('workflow_spec_workflow_spec_category_id_fkey', 'workflow_spec', 'workflow_spec_category', ['workflow_spec_category_id'], ['id'])
op.drop_column('workflow_spec', 'category_id')
op.drop_column('workflow', 'total_tasks')
op.drop_column('workflow', 'completed_tasks')
# ### end Alembic commands ###