"""update user table

Revision ID: decd3d385f85
Revises: 227d7972fc56
Create Date: 2019-07-30 22:27:58.266318

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'decd3d385f85'
down_revision = '227d7972fc56'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('access_token', sa.String(length=200), nullable=True))
    op.add_column('user', sa.Column('is_activated', sa.Boolean(), nullable=True))
    op.alter_column('user', 'avatar_url',
                    existing_type=sa.VARCHAR(length=200),
                    nullable=True)
    op.alter_column('user', 'name',
                    existing_type=sa.VARCHAR(length=50),
                    nullable=True)
    op.alter_column('user', 'refresh_token',
                    existing_type=sa.VARCHAR(length=100),
                    nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user', 'refresh_token',
                    existing_type=sa.VARCHAR(length=100))
    op.alter_column('user', 'name',
                    existing_type=sa.VARCHAR(length=50))
    op.alter_column('user', 'avatar_url',
                    existing_type=sa.VARCHAR(length=200))
    op.drop_column('user', 'is_activated')
    op.drop_column('user', 'access_token')
    # ### end Alembic commands ###
