"""empty message

Revision ID: 6a1d5b118d31
Revises: 495a88477b8c
Create Date: 2018-03-07 15:19:31.806238

"""

# revision identifiers, used by Alembic.
revision = '6a1d5b118d31'
down_revision = '495a88477b8c'

from alembic import op
import sqlalchemy as sa


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('o_auth2_token', sa.Column('id', sa.Integer(), nullable=False))
    op.add_column('o_auth2_token', sa.Column('token_type', sa.String(length=100), nullable=True))
    op.alter_column('o_auth2_token', 'access_token',
               existing_type=sa.VARCHAR(length=48),
               type_=sa.String(length=500),
               existing_nullable=False)
    op.alter_column('o_auth2_token', 'user_id',
               existing_type=sa.INTEGER(),
               type_=sa.String(length=255),
               existing_nullable=False)
    op.add_column('user', sa.Column('first_name', sa.String(length=255), nullable=True))
    op.add_column('user', sa.Column('last_name', sa.String(length=255), nullable=True))
    op.add_column('user', sa.Column('name', sa.String(length=255), nullable=True))
    op.add_column('user', sa.Column('picture_url', sa.String(length=500), nullable=True))
    op.drop_column('user', 'password')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('password', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.drop_column('user', 'picture_url')
    op.drop_column('user', 'name')
    op.drop_column('user', 'last_name')
    op.drop_column('user', 'first_name')
    op.alter_column('o_auth2_token', 'user_id',
               existing_type=sa.String(length=255),
               type_=sa.INTEGER(),
               existing_nullable=False)
    op.alter_column('o_auth2_token', 'access_token',
               existing_type=sa.String(length=500),
               type_=sa.VARCHAR(length=48),
               existing_nullable=False)
    op.drop_column('o_auth2_token', 'token_type')
    op.drop_column('o_auth2_token', 'id')
    # ### end Alembic commands ###
