"""empty message

Revision ID: 845486662682
Revises: 80ec61bd9b4e
Create Date: 2018-08-06 20:00:26.418770

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '845486662682'
down_revision = '80ec61bd9b4e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('highlight_post',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_foreign_key(None, 'board', 'cms_user', ['author_id'], ['id'])
    op.create_foreign_key(None, 'cms_user_role', 'cms_role', ['role_id'], ['id'])
    op.create_foreign_key(None, 'cms_user_role', 'cms_user', ['user_id'], ['id'])
    op.add_column('post', sa.Column('highlight_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'post', 'highlight_post', ['highlight_id'], ['id'])
    op.create_foreign_key(None, 'post', 'board', ['board_id'], ['id'])
    op.create_foreign_key(None, 'post', 'front_user', ['author_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.drop_column('post', 'highlight_id')
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.drop_constraint(None, 'board', type_='foreignkey')
    op.drop_table('highlight_post')
    # ### end Alembic commands ###
