"""Remove permission_type_id

Revision ID: b4628b5a3f23
Revises: 5de499ab5b62
Create Date: 2016-12-16 22:30:00.043326

"""

# revision identifiers, used by Alembic.
revision = 'b4628b5a3f23'
down_revision = '5de499ab5b62'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('user_permission_type_fk', 'users', type_='foreignkey')
    op.drop_column('users', 'permission_type_id')
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('permission_type_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('user_permission_type_fk', 'users', 'permission_type', ['permission_type_id'], ['permission_type_id'])
    ### end Alembic commands ###

