"""empty message

Revision ID: e0bfc3d03fb3
Revises: 7bc080bd6b4c
Create Date: 2019-05-23 11:07:41.819102

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e0bfc3d03fb3'
down_revision = '7bc080bd6b4c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('center_manage')
    op.add_column('distcenter', sa.Column('managed_by', sa.String(length=100), nullable=True))
    op.create_foreign_key(None, 'distcenter', 'useradmin', ['managed_by'], ['public_id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'distcenter', type_='foreignkey')
    op.drop_column('distcenter', 'managed_by')
    op.create_table('center_manage',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('admin_id', sa.VARCHAR(length=100), autoincrement=False, nullable=True),
    sa.Column('center_id', sa.VARCHAR(length=100), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['admin_id'], ['useradmin.public_id'], name='center_manage_admin_id_fkey'),
    sa.ForeignKeyConstraint(['center_id'], ['distcenter.public_id'], name='center_manage_center_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='center_manage_pkey')
    )
    # ### end Alembic commands ###
