"""cmf_task_code_history

Revision ID: 09b099317a95
Revises: 65bb840466d1
Create Date: 2023-04-11 20:02:20.942116

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '09b099317a95'
down_revision = '65bb840466d1'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_task_code_history', sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False))
    op.add_column('cmf_task_code_history', sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False))
    op.add_column('cmf_task_code_history', sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_deleted', sa.Boolean(), nullable=False))
    op.add_column('cmf_task_code_history', sa.Column('cmf_version', sa.BIGINT(), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_author_id', sa.String(length=64), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_owner_id', sa.String(length=64), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('parent_id', sa.String(length=64), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True))
    op.add_column('cmf_task_code_history', sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_task_code_history_cmf_author_id'), 'cmf_task_code_history', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_created_at'), 'cmf_task_code_history', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_deleted'), 'cmf_task_code_history', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_locked_at'), 'cmf_task_code_history', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_locked_by_id'), 'cmf_task_code_history', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_modified_at'), 'cmf_task_code_history', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_modified_by_id'), 'cmf_task_code_history', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_owner_id'), 'cmf_task_code_history', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_version'), 'cmf_task_code_history', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_cmf_viewed_at'), 'cmf_task_code_history', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_task_code_history_parent_id'), 'cmf_task_code_history', ['parent_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_parent_id'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_viewed_at'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_version'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_owner_id'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_modified_by_id'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_modified_at'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_locked_by_id'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_locked_at'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_deleted'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_created_at'), table_name='cmf_task_code_history')
    op.drop_index(op.f('ix_cmf_task_code_history_cmf_author_id'), table_name='cmf_task_code_history')
    op.drop_column('cmf_task_code_history', 'cmf_locked_by_id')
    op.drop_column('cmf_task_code_history', 'cmf_modified_by_id')
    op.drop_column('cmf_task_code_history', 'parent_id')
    op.drop_column('cmf_task_code_history', 'cmf_owner_id')
    op.drop_column('cmf_task_code_history', 'cmf_author_id')
    op.drop_column('cmf_task_code_history', 'cmf_version')
    op.drop_column('cmf_task_code_history', 'cmf_deleted')
    op.drop_column('cmf_task_code_history', 'cmf_viewed_at')
    op.drop_column('cmf_task_code_history', 'cmf_modified_at')
    op.drop_column('cmf_task_code_history', 'cmf_created_at')
    op.drop_column('cmf_task_code_history', 'cmf_locked_at')
    # ### end Alembic commands ###
