"""Task code history

Revision ID: a8df0d8db286
Revises: 49f9bb12f215
Create Date: 2023-03-31 13:29:10.585916

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a8df0d8db286'
down_revision = '49f9bb12f215'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_task_code_history',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('code', sa.String(length=64), nullable=False),
    sa.Column('task_id', sa.String(length=64), nullable=False),
    sa.ForeignKeyConstraint(['task_id'], ['cmf_task.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_task_code_history_code'), 'cmf_task_code_history', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_task_code_history_task_id'), 'cmf_task_code_history', ['task_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_task_code_history_task_id'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_code'), table_name='cmf_task_code_history')
    op.drop_table('cmf_task_code_history')
    # ### end Alembic commands ###
