"""init tables

Revision ID: fb51bd195dcb
Revises: 1acfb6eef2f1
Create Date: 2018-11-09 22:51:05.521837

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'fb51bd195dcb'
down_revision = '1acfb6eef2f1'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('article_info', sa.Column('category_id', sa.Integer(), nullable=False))
    op.drop_constraint('article_info_ibfk_1', 'article_info', type_='foreignkey')
    op.create_foreign_key(None, 'article_info', 'category_info', ['category_id'], ['id'])
    op.drop_column('article_info', 'area_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('article_info', sa.Column('area_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'article_info', type_='foreignkey')
    op.create_foreign_key('article_info_ibfk_1', 'article_info', 'category_info', ['area_id'], ['id'])
    op.drop_column('article_info', 'category_id')
    # ### end Alembic commands ###
