"""Add scriptPubkey boolean fields

Revision ID: 29018199faab
Revises: 1b3e01f7ddf0
Create Date: 2014-07-01 18:08:24.353642

"""

# revision identifiers, used by Alembic.
revision = '29018199faab'
down_revision = '1b3e01f7ddf0'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('transaction', sa.Column('has_multisig', sa.Boolean(), nullable=True))
    op.add_column('transaction', sa.Column('has_nulldata', sa.Boolean(), nullable=True))
    op.add_column('transaction', sa.Column('has_pubkey', sa.Boolean(), nullable=True))
    op.add_column('transaction', sa.Column('has_pubkeyhash', sa.Boolean(), nullable=True))
    op.add_column('transaction', sa.Column('has_scripthash', sa.Boolean(), nullable=True))
    op.create_index(op.f('ix_transaction_has_multisig'), 'transaction', ['has_multisig'], unique=False)
    op.create_index(op.f('ix_transaction_has_nulldata'), 'transaction', ['has_nulldata'], unique=False)
    op.create_index(op.f('ix_transaction_has_pubkey'), 'transaction', ['has_pubkey'], unique=False)
    op.create_index(op.f('ix_transaction_has_pubkeyhash'), 'transaction', ['has_pubkeyhash'], unique=False)
    op.create_index(op.f('ix_transaction_has_scripthash'), 'transaction', ['has_scripthash'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_transaction_has_scripthash'), table_name='transaction')
    op.drop_index(op.f('ix_transaction_has_pubkeyhash'), table_name='transaction')
    op.drop_index(op.f('ix_transaction_has_pubkey'), table_name='transaction')
    op.drop_index(op.f('ix_transaction_has_nulldata'), table_name='transaction')
    op.drop_index(op.f('ix_transaction_has_multisig'), table_name='transaction')
    op.drop_column('transaction', 'has_scripthash')
    op.drop_column('transaction', 'has_pubkeyhash')
    op.drop_column('transaction', 'has_pubkey')
    op.drop_column('transaction', 'has_nulldata')
    op.drop_column('transaction', 'has_multisig')
    ### end Alembic commands ###
