"""empty message

Revision ID: 14f6fac39801
Revises: 858cdfc6bd71
Create Date: 2020-09-17 16:49:37.303861

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '14f6fac39801'
down_revision = '858cdfc6bd71'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_kanban_status_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_kanban_status_objects_left_id'), 'cmf_kanban_status_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_objects_right_id'), 'cmf_kanban_status_objects', ['right_id'], unique=False)
    op.create_table('cmf_kanban_status',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('color', sa.String(length=32), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('work_list_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.ForeignKeyConstraint(['work_list_id'], ['cmf_u_work_list.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_kanban_status_cmf_author_id'), 'cmf_kanban_status', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_cmf_locked_by_id'), 'cmf_kanban_status', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_cmf_modified_by_id'), 'cmf_kanban_status', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_cmf_owner_id'), 'cmf_kanban_status', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_code'), 'cmf_kanban_status', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_kanban_status_name'), 'cmf_kanban_status', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_orderno'), 'cmf_kanban_status', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_status_id'), 'cmf_kanban_status', ['status_id'], unique=False)
    op.create_index(op.f('ix_cmf_kanban_status_work_list_id'), 'cmf_kanban_status', ['work_list_id'], unique=False)
    # op.create_index(op.f('ix_cmf_event_event_person_id'), 'cmf_event', ['event_person_id'], unique=False)
    # op.create_index(op.f('ix_cmf_event_object_id'), 'cmf_event', ['object_id'], unique=False)
    # op.create_index(op.f('ix_cmf_event_view_object_id'), 'cmf_event', ['view_object_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_index(op.f('ix_cmf_event_view_object_id'), table_name='cmf_event')
    # op.drop_index(op.f('ix_cmf_event_object_id'), table_name='cmf_event')
    # op.drop_index(op.f('ix_cmf_event_event_person_id'), table_name='cmf_event')
    op.drop_index(op.f('ix_cmf_kanban_status_work_list_id'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_status_id'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_orderno'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_name'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_code'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_cmf_owner_id'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_cmf_modified_by_id'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_cmf_locked_by_id'), table_name='cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_cmf_author_id'), table_name='cmf_kanban_status')
    op.drop_table('cmf_kanban_status')
    op.drop_index(op.f('ix_cmf_kanban_status_objects_right_id'), table_name='cmf_kanban_status_objects')
    op.drop_index(op.f('ix_cmf_kanban_status_objects_left_id'), table_name='cmf_kanban_status_objects')
    op.drop_table('cmf_kanban_status_objects')
    # ### end Alembic commands ###
