"""empty message

Revision ID: a9bd02536f0c
Revises: c75287270fcf
Create Date: 2018-10-26 22:09:16.768485

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a9bd02536f0c'
down_revision = 'c75287270fcf'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('external_login',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('social_id', sa.String(length=64), nullable=False),
    sa.Column('nickname', sa.String(length=64), nullable=False),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('social_id')
    )
    op.drop_constraint('user_social_id_key', 'user', type_='unique')
    op.drop_column('user', 'nickname')
    op.drop_column('user', 'email')
    op.drop_column('user', 'social_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('social_id', sa.VARCHAR(length=64), autoincrement=False, nullable=False))
    op.add_column('user', sa.Column('email', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('user', sa.Column('nickname', sa.VARCHAR(length=64), autoincrement=False, nullable=False))
    op.create_unique_constraint('user_social_id_key', 'user', ['social_id'])
    op.drop_table('external_login')
    # ### end Alembic commands ###
