"""Changes to identity table

Revision ID: c4ca265d296c
Revises: 9c3a319111a0
Create Date: 2016-02-02 22:45:36.139066

"""

# revision identifiers, used by Alembic.
revision = 'c4ca265d296c'
down_revision = '9c3a319111a0'
branch_labels = None
depends_on = None

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('identity', sa.Column('code', sa.String(length=16), nullable=False))
    op.alter_column('identity', 'image_url',
               existing_type=mysql.VARCHAR(length=256),
               nullable=True)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('identity', 'image_url',
               existing_type=mysql.VARCHAR(length=256),
               nullable=False)
    op.drop_column('identity', 'code')
    ### end Alembic commands ###
