"""empty message

Revision ID: 31b9572e3ac9
Revises: 6861bcb97478
Create Date: 2019-03-01 05:42:40.594722

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '31b9572e3ac9'
down_revision = '6861bcb97478'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('app_user', sa.Column('device_token', sa.String(length=128), nullable=True))
    op.add_column('app_user', sa.Column('google_id', sa.String(length=128), nullable=True))
    op.alter_column('app_user', 'phone_number',
               existing_type=sa.VARCHAR(length=32),
               nullable=True)
    op.create_unique_constraint(None, 'app_user', ['device_token'])
    op.create_unique_constraint(None, 'app_user', ['google_id'])
    op.add_column('task', sa.Column('grade', sa.Integer(), nullable=True))
    op.alter_column('task', 'exchange_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('task', 'exchange_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('task', 'grade')
    op.drop_constraint(None, 'app_user', type_='unique')
    op.drop_constraint(None, 'app_user', type_='unique')
    op.alter_column('app_user', 'phone_number',
               existing_type=sa.VARCHAR(length=32),
               nullable=False)
    op.drop_column('app_user', 'google_id')
    op.drop_column('app_user', 'device_token')
    # ### end Alembic commands ###
