"""empty message

Revision ID: 19a9193e9768
Revises: 23f3da432c69
Create Date: 2019-03-27 20:50:07.866624

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '19a9193e9768'
down_revision = '23f3da432c69'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_prepared_transfer_sender_creditor_id', table_name='prepared_transfer')
    op.create_index('idx_prepared_transfer_sender_creditor_id', 'prepared_transfer', ['debtor_id', 'sender_creditor_id'], unique=False)
    op.drop_constraint('prepared_transfer_debtor_id_fkey1', 'prepared_transfer', type_='foreignkey')
    op.drop_column('prepared_transfer', 'withdrawal_request_seqnum')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('prepared_transfer', sa.Column('withdrawal_request_seqnum', sa.BIGINT(), autoincrement=False, nullable=True))
    op.create_foreign_key('prepared_transfer_debtor_id_fkey1', 'prepared_transfer', 'withdrawal_request', ['debtor_id', 'sender_creditor_id', 'withdrawal_request_seqnum'], ['debtor_id', 'creditor_id', 'withdrawal_request_seqnum'])
    op.drop_index('idx_prepared_transfer_sender_creditor_id', table_name='prepared_transfer')
    op.create_index('idx_prepared_transfer_sender_creditor_id', 'prepared_transfer', ['debtor_id', 'sender_creditor_id', 'withdrawal_request_seqnum'], unique=True)
    # ### end Alembic commands ###
