"""empty message

Revision ID: 53f5ab9da859
Revises: 8b2cd63804b3
Create Date: 2019-02-04 15:09:58.315410

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '53f5ab9da859'
down_revision = '8b2cd63804b3'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('group', sa.Column('description', sa.UnicodeText(), nullable=True))
    op.drop_index('ix_group_privilege_gid', table_name='group_privilege')
    op.add_column('special_privilege', sa.Column('mid', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_special_privilege_mid'), 'special_privilege', ['mid'], unique=False)
    op.drop_index('ix_special_privilege_uid', table_name='special_privilege')
    op.drop_constraint('special_privilege_uid_fkey', 'special_privilege', type_='foreignkey')
    op.create_foreign_key(None, 'special_privilege', 'member', ['mid'], ['id'])
    op.drop_column('special_privilege', 'uid')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('special_privilege', sa.Column('uid', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'special_privilege', type_='foreignkey')
    op.create_foreign_key('special_privilege_uid_fkey', 'special_privilege', 'user', ['uid'], ['id'])
    op.create_index('ix_special_privilege_uid', 'special_privilege', ['uid'], unique=False)
    op.drop_index(op.f('ix_special_privilege_mid'), table_name='special_privilege')
    op.drop_column('special_privilege', 'mid')
    op.create_index('ix_group_privilege_gid', 'group_privilege', ['gid'], unique=False)
    op.drop_column('group', 'description')
    # ### end Alembic commands ###
