"""Add indices for TransactionAddress related tables

Revision ID: 352aa49de335
Revises: 4f31c21d000
Create Date: 2014-07-08 15:45:26.197747

"""

# revision identifiers, used by Alembic.
revision = '352aa49de335'
down_revision = '4f31c21d000'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_index(op.f('ix_transaction_address_address'), 'transaction_address', ['address'], unique=False)
    op.create_index(op.f('ix_transaction_address_txid'), 'transaction_address', ['txid'], unique=False)
    op.create_index(op.f('ix_transaction_address_vout_index'), 'transaction_address', ['vout_index'], unique=False)
    op.create_index(op.f('ix_transaction_address_info_address'), 'transaction_address_info', ['address'], unique=False)
    op.create_index(op.f('ix_transaction_spending_input_txid'), 'transaction_spending', ['input_txid'], unique=False)
    op.create_index(op.f('ix_transaction_spending_txid'), 'transaction_spending', ['txid'], unique=False)
    op.create_index(op.f('ix_transaction_spending_vout_index'), 'transaction_spending', ['vout_index'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_transaction_spending_vout_index'), table_name='transaction_spending')
    op.drop_index(op.f('ix_transaction_spending_txid'), table_name='transaction_spending')
    op.drop_index(op.f('ix_transaction_spending_input_txid'), table_name='transaction_spending')
    op.drop_index(op.f('ix_transaction_address_info_address'), table_name='transaction_address_info')
    op.drop_index(op.f('ix_transaction_address_vout_index'), table_name='transaction_address')
    op.drop_index(op.f('ix_transaction_address_txid'), table_name='transaction_address')
    op.drop_index(op.f('ix_transaction_address_address'), table_name='transaction_address')
    ### end Alembic commands ###
