"""Includes extra properties (Location, Business Categories) to the DUNS table

Revision ID: b35d25a57731
Revises: 7ffc95637ee4
Create Date: 2018-07-11 00:16:42.135797

"""

# revision identifiers, used by Alembic.
revision = 'b35d25a57731'
down_revision = '2cdb67bec1d3'
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.add_column('duns', sa.Column('address_line_1', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('address_line_2', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('business_types_codes', sa.ARRAY(sa.Text()), nullable=True))
    op.add_column('duns', sa.Column('city', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('congressional_district', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('country_code', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('state', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('zip', sa.Text(), nullable=True))
    op.add_column('duns', sa.Column('zip4', sa.Text(), nullable=True))
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('duns', 'zip4')
    op.drop_column('duns', 'zip')
    op.drop_column('duns', 'state')
    op.drop_column('duns', 'country_code')
    op.drop_column('duns', 'congressional_district')
    op.drop_column('duns', 'city')
    op.drop_column('duns', 'business_types_codes')
    op.drop_column('duns', 'address_line_2')
    op.drop_column('duns', 'address_line_1')
    ### end Alembic commands ###

