"""topic deleted

Revision ID: 5cc7fa723a58
Revises: 887cd3ffe259
Create Date: 2017-07-12 11:49:46.236439

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5cc7fa723a58'
down_revision = '887cd3ffe259'
branch_labels = None
depends_on = None
set_deleted = """
UPDATE topics SET deleted = False
"""


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('topics', sa.Column('deleted', sa.Boolean(), nullable=True))
    op.create_index(op.f('ix_topics_deleted'), 'topics', ['deleted'], unique=False)
    # ### end Alembic commands ###
    op.execute(set_deleted)


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_topics_deleted'), table_name='topics')
    op.drop_column('topics', 'deleted')
    # ### end Alembic commands ###
