"""change user

Revision ID: 35de3b75c0ea
Revises: 7443ec5ef9fd
Create Date: 2016-10-10 22:26:40.240801

"""

# revision identifiers, used by Alembic.
revision = '35de3b75c0ea'
down_revision = '7443ec5ef9fd'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('birthday', sa.DateTime(), nullable=True))
    op.add_column('users', sa.Column('employee_id', sa.Integer(), nullable=True))
    op.add_column('users', sa.Column('gender', sa.Integer(), nullable=True))
    op.add_column('users', sa.Column('mobile', sa.String(length=20), nullable=True))
    op.add_column('users', sa.Column('name', sa.String(length=64), nullable=True))
    op.add_column('users', sa.Column('position', sa.String(length=30), nullable=True))
    op.add_column('users', sa.Column('remark', sa.String(length=64), nullable=True))
    op.drop_index('ix_users_username', table_name='users')
    op.drop_column('users', 'username')
    op.drop_column('users', 'nickname')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('nickname', mysql.VARCHAR(length=64), nullable=True))
    op.add_column('users', sa.Column('username', mysql.VARCHAR(length=64), nullable=True))
    op.create_index('ix_users_username', 'users', ['username'], unique=True)
    op.drop_column('users', 'remark')
    op.drop_column('users', 'position')
    op.drop_column('users', 'name')
    op.drop_column('users', 'mobile')
    op.drop_column('users', 'gender')
    op.drop_column('users', 'employee_id')
    op.drop_column('users', 'birthday')
    ### end Alembic commands ###
