"""remove password_hash add active_connect_id

Revision ID: efe1d6d70d2a
Revises: 834b1a697901
Create Date: 2020-06-05 08:18:33.374077

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'efe1d6d70d2a'
down_revision = '834b1a697901'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('active_connect_id', sa.String(length=32), nullable=True))
    op.create_index(op.f('ix_user_active_connect_id'), 'user', ['active_connect_id'], unique=True)
    with op.batch_alter_table('user') as batch_op:
        batch_op.drop_column('password_hash')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('password_hash', sa.VARCHAR(length=128), nullable=True))
    op.drop_index(op.f('ix_user_active_connect_id'), table_name='user')
    op.drop_column('user', 'active_connect_id')
    # ### end Alembic commands ###
