"""historic_parent_duns

Revision ID: 7ffc95637ee4
Revises: 7d2d17f4e86a
Create Date: 2018-06-15 16:15:59.249114

"""

# revision identifiers, used by Alembic.
revision = '7ffc95637ee4'
down_revision = '7d2d17f4e86a'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('historic_parent_duns',
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('duns_id', sa.Integer(), nullable=False),
    sa.Column('year', sa.Integer(), nullable=True),
    sa.Column('awardee_or_recipient_uniqu', sa.Text(), nullable=True),
    sa.Column('legal_business_name', sa.Text(), nullable=True),
    sa.Column('activation_date', sa.Date(), nullable=True),
    sa.Column('deactivation_date', sa.Date(), nullable=True),
    sa.Column('registration_date', sa.Date(), nullable=True),
    sa.Column('expiration_date', sa.Date(), nullable=True),
    sa.Column('last_sam_mod_date', sa.Date(), nullable=True),
    sa.Column('ultimate_parent_unique_ide', sa.Text(), nullable=True),
    sa.Column('ultimate_parent_legal_enti', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('duns_id')
    )
    op.create_index(op.f('ix_historic_parent_duns_activation_date'), 'historic_parent_duns', ['activation_date'], unique=False)
    op.create_index(op.f('ix_historic_parent_duns_awardee_or_recipient_uniqu'), 'historic_parent_duns', ['awardee_or_recipient_uniqu'], unique=False)
    op.create_index(op.f('ix_historic_parent_duns_deactivation_date'), 'historic_parent_duns', ['deactivation_date'], unique=False)
    op.create_index(op.f('ix_historic_parent_duns_expiration_date'), 'historic_parent_duns', ['expiration_date'], unique=False)
    op.create_index(op.f('ix_historic_parent_duns_registration_date'), 'historic_parent_duns', ['registration_date'], unique=False)
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_historic_parent_duns_registration_date'), table_name='historic_parent_duns')
    op.drop_index(op.f('ix_historic_parent_duns_expiration_date'), table_name='historic_parent_duns')
    op.drop_index(op.f('ix_historic_parent_duns_deactivation_date'), table_name='historic_parent_duns')
    op.drop_index(op.f('ix_historic_parent_duns_awardee_or_recipient_uniqu'), table_name='historic_parent_duns')
    op.drop_index(op.f('ix_historic_parent_duns_activation_date'), table_name='historic_parent_duns')
    op.drop_table('historic_parent_duns')
    ### end Alembic commands ###

