"""empty message

Revision ID: 2b563013d888
Revises: ea2b7da13e50
Create Date: 2018-07-28 20:37:20.491495

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

# revision identifiers, used by Alembic.
revision = '2b563013d888'
down_revision = 'ea2b7da13e50'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cms_role', sa.Column('permissions', sa.Integer(), nullable=False))
    op.drop_column('cms_role', 'permission')
    op.create_foreign_key(None, 'cms_user_role', 'cms_user', ['user_id'], ['id'])
    op.create_foreign_key(None, 'cms_user_role', 'cms_role', ['role_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.add_column('cms_role', sa.Column('permission', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
    op.drop_column('cms_role', 'permissions')
    # ### end Alembic commands ###
