"""update database by change env.person_in_charge to link to User

Revision ID: 2666ea9618d7
Revises: 75b9cbe8ad89
Create Date: 2018-06-12 18:02:14.589352

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

# revision identifiers, used by Alembic.
revision = '2666ea9618d7'
down_revision = '75b9cbe8ad89'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(), nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], ['id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('env', sa.Column('person_in_charge', mysql.VARCHAR(length=32), nullable=False))
    op.drop_constraint(None, 'env', type_='foreignkey')
    op.create_index('ix_env_person_in_charge', 'env', ['person_in_charge'], unique=True)
    op.drop_column('env', 'person_in_charge_id')
    # ### end Alembic commands ###

93f5911d6a8e598c4c6ac8b7c44f2130ceec026a
<mask token>


def upgrade():
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(),
        nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], [
        'id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')


<mask token>

<mask token>


def upgrade():
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(),
        nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], [
        'id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')


def downgrade():
    op.add_column('env', sa.Column('person_in_charge', mysql.VARCHAR(length
        =32), nullable=False))
    op.drop_constraint(None, 'env', type_='foreignkey')
    op.create_index('ix_env_person_in_charge', 'env', ['person_in_charge'],
        unique=True)
    op.drop_column('env', 'person_in_charge_id')

<mask token>
revision = '2666ea9618d7'
down_revision = '75b9cbe8ad89'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(),
        nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], [
        'id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')


def downgrade():
    op.add_column('env', sa.Column('person_in_charge', mysql.VARCHAR(length
        =32), nullable=False))
    op.drop_constraint(None, 'env', type_='foreignkey')
    op.create_index('ix_env_person_in_charge', 'env', ['person_in_charge'],
        unique=True)
    op.drop_column('env', 'person_in_charge_id')

<mask token>
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = '2666ea9618d7'
down_revision = '75b9cbe8ad89'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(),
        nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], [
        'id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')


def downgrade():
    op.add_column('env', sa.Column('person_in_charge', mysql.VARCHAR(length
        =32), nullable=False))
    op.drop_constraint(None, 'env', type_='foreignkey')
    op.create_index('ix_env_person_in_charge', 'env', ['person_in_charge'],
        unique=True)
    op.drop_column('env', 'person_in_charge_id')

"""update database by change env.person_in_charge to link to User

Revision ID: 2666ea9618d7
Revises: 75b9cbe8ad89
Create Date: 2018-06-12 18:02:14.589352

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

# revision identifiers, used by Alembic.
revision = '2666ea9618d7'
down_revision = '75b9cbe8ad89'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('env', sa.Column('person_in_charge_id', sa.Integer(), nullable=True))
    op.drop_index('ix_env_person_in_charge', table_name='env')
    op.create_foreign_key(None, 'env', 'user', ['person_in_charge_id'], ['id'], ondelete='SET NULL')
    op.drop_column('env', 'person_in_charge')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('env', sa.Column('person_in_charge', mysql.VARCHAR(length=32), nullable=False))
    op.drop_constraint(None, 'env', type_='foreignkey')
    op.create_index('ix_env_person_in_charge', 'env', ['person_in_charge'], unique=True)
    op.drop_column('env', 'person_in_charge_id')
    # ### end Alembic commands ###
