"""add normalized user names

Revision ID: a6e89f3510d9
Revises: 0fffe230b8ba
Create Date: 2019-06-05 19:50:08.493893

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a6e89f3510d9'
down_revision = '0fffe230b8ba'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('member', sa.Column('norm', sa.Unicode(length=32), nullable=True))
    op.create_index(op.f('ix_member_norm'), 'member', ['norm'], unique=True)
    op.drop_index('ix_member_name', table_name='member')
    op.create_index(op.f('ix_member_name'), 'member', ['name'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_member_name'), table_name='member')
    op.create_index('ix_member_name', 'member', ['name'], unique=True)
    op.drop_index(op.f('ix_member_norm'), table_name='member')
    op.drop_column('member', 'norm')
    # ### end Alembic commands ###
