"""revamp externallinks table

Revision ID: 5d73a92c8979
Revises: d7fab1079843
Create Date: 2018-08-23 19:07:00.659136

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5d73a92c8979'
down_revision = 'd7fab1079843'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('externallinks', 'el_index')
    op.drop_column('externallinks', 'el_id')
    # ### end Alembic commands ###
    op.create_primary_key('externallinks_pkey', 'externallinks', ['el_from', 'el_to'])


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('externallinks', sa.Column('el_id', sa.INTEGER(), autoincrement=True, nullable=True))
    op.add_column('externallinks', sa.Column('el_index', sa.TEXT(), autoincrement=False, nullable=True))
    # ### end Alembic commands ###
    op.drop_constraint('externallinks_pkey', table_name='externallinks')
