"""Add descriptions to AwardProcurement

Revision ID: 668d9fa93acb
Revises: 224dac8f951c
Create Date: 2018-04-02 09:30:16.347112

"""

# revision identifiers, used by Alembic.
revision = '668d9fa93acb'
down_revision = '224dac8f951c'
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.execute("ALTER TABLE award_procurement RENAME COLUMN referenced_multi_or_single TO referenced_mult_or_single")
    op.execute("ALTER TABLE award_procurement RENAME COLUMN legal_entity_state_code TO legal_entity_state_descrip")
    op.add_column('award_procurement', sa.Column('a_76_fair_act_action_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('action_type_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('clinger_cohen_act_pla_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('commercial_item_acqui_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('commercial_item_test_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('consolidated_contract_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('construction_wage_rat_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('contingency_humanitar_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('contract_award_type_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('contract_bundling_descrip', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('contract_financing_descrip', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('contracting_officers_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('cost_accounting_stand_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('cost_or_pricing_data_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('country_of_product_or_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('dod_claimant_prog_cod_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('domestic_or_foreign_e_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('epa_designated_produc_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('evaluated_preference_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('extent_compete_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('fair_opportunity_limi_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('fed_biz_opps_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('foreign_funding_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('government_furnished_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('idv_type_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('information_technolog_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('inherently_government_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('interagency_contract_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('labor_standards_descrip', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('last_modified', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('legal_entity_state_code', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('local_area_set_aside_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('materials_supplies_descrip', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('multi_year_contract_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('multiple_or_single_aw_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('national_interest_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('other_than_full_and_o_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('performance_based_se_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('place_of_manufacture_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('place_of_performance_city', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('product_or_service_co_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('program_system_or_equ_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('purchase_card_as_paym_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('recovered_materials_s_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('referenced_idv_type_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('referenced_mult_or_si_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('research_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('sam_exception_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('sea_transportation_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('solicitation_procedur_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('subcontracting_plan_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('type_of_contract_pric_desc', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('type_of_idc_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('type_set_aside_description', sa.Text(), nullable=True))
    op.add_column('award_procurement', sa.Column('undefinitized_action_desc', sa.Text(), nullable=True))
    op.add_column('detached_award_procurement', sa.Column('inherently_government_desc', sa.Text(), nullable=True))
    op.drop_column('detached_award_procurement', 'referenced_multi_or_single')
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('detached_award_procurement', sa.Column('referenced_multi_or_single', sa.TEXT(), autoincrement=False, nullable=True))
    op.drop_column('detached_award_procurement', 'inherently_government_desc')
    op.drop_column('award_procurement', 'undefinitized_action_desc')
    op.drop_column('award_procurement', 'type_set_aside_description')
    op.drop_column('award_procurement', 'type_of_idc_description')
    op.drop_column('award_procurement', 'type_of_contract_pric_desc')
    op.drop_column('award_procurement', 'subcontracting_plan_desc')
    op.drop_column('award_procurement', 'solicitation_procedur_desc')
    op.drop_column('award_procurement', 'sea_transportation_desc')
    op.drop_column('award_procurement', 'sam_exception_description')
    op.drop_column('award_procurement', 'research_description')
    op.drop_column('award_procurement', 'referenced_mult_or_si_desc')
    op.drop_column('award_procurement', 'referenced_idv_type_desc')
    op.drop_column('award_procurement', 'recovered_materials_s_desc')
    op.drop_column('award_procurement', 'purchase_card_as_paym_desc')
    op.drop_column('award_procurement', 'program_system_or_equ_desc')
    op.drop_column('award_procurement', 'product_or_service_co_desc')
    op.drop_column('award_procurement', 'place_of_performance_city')
    op.drop_column('award_procurement', 'place_of_manufacture_desc')
    op.drop_column('award_procurement', 'performance_based_se_desc')
    op.drop_column('award_procurement', 'other_than_full_and_o_desc')
    op.drop_column('award_procurement', 'national_interest_desc')
    op.drop_column('award_procurement', 'multiple_or_single_aw_desc')
    op.drop_column('award_procurement', 'multi_year_contract_desc')
    op.drop_column('award_procurement', 'materials_supplies_descrip')
    op.drop_column('award_procurement', 'local_area_set_aside_desc')
    op.drop_column('award_procurement', 'legal_entity_state_code')
    op.drop_column('award_procurement', 'last_modified')
    op.drop_column('award_procurement', 'labor_standards_descrip')
    op.drop_column('award_procurement', 'interagency_contract_desc')
    op.drop_column('award_procurement', 'inherently_government_desc')
    op.drop_column('award_procurement', 'information_technolog_desc')
    op.drop_column('award_procurement', 'idv_type_description')
    op.drop_column('award_procurement', 'government_furnished_desc')
    op.drop_column('award_procurement', 'foreign_funding_desc')
    op.drop_column('award_procurement', 'fed_biz_opps_description')
    op.drop_column('award_procurement', 'fair_opportunity_limi_desc')
    op.drop_column('award_procurement', 'extent_compete_description')
    op.drop_column('award_procurement', 'evaluated_preference_desc')
    op.drop_column('award_procurement', 'epa_designated_produc_desc')
    op.drop_column('award_procurement', 'domestic_or_foreign_e_desc')
    op.drop_column('award_procurement', 'dod_claimant_prog_cod_desc')
    op.drop_column('award_procurement', 'country_of_product_or_desc')
    op.drop_column('award_procurement', 'cost_or_pricing_data_desc')
    op.drop_column('award_procurement', 'cost_accounting_stand_desc')
    op.drop_column('award_procurement', 'contracting_officers_desc')
    op.drop_column('award_procurement', 'contract_financing_descrip')
    op.drop_column('award_procurement', 'contract_bundling_descrip')
    op.drop_column('award_procurement', 'contract_award_type_desc')
    op.drop_column('award_procurement', 'contingency_humanitar_desc')
    op.drop_column('award_procurement', 'construction_wage_rat_desc')
    op.drop_column('award_procurement', 'consolidated_contract_desc')
    op.drop_column('award_procurement', 'commercial_item_test_desc')
    op.drop_column('award_procurement', 'commercial_item_acqui_desc')
    op.drop_column('award_procurement', 'clinger_cohen_act_pla_desc')
    op.drop_column('award_procurement', 'action_type_description')
    op.drop_column('award_procurement', 'a_76_fair_act_action_desc')
    op.execute("ALTER TABLE award_procurement RENAME COLUMN legal_entity_state_descrip TO legal_entity_state_code")
    op.execute("ALTER TABLE award_procurement RENAME COLUMN referenced_mult_or_single TO referenced_multi_or_single")
    ### end Alembic commands ###

