"""Create zips_grouped_historical table

Revision ID: 1d6a64351486
Revises: eefb24761306
Create Date: 2022-12-05 11:15:24.175493

"""

# revision identifiers, used by Alembic.
revision = '1d6a64351486'
down_revision = 'eefb24761306'
branch_labels = None
depends_on = None

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

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('zips_grouped_historical',
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('zips_grouped_historical_id', sa.Integer(), nullable=False),
    sa.Column('zip5', sa.Text(), nullable=True),
    sa.Column('state_abbreviation', sa.Text(), nullable=True),
    sa.Column('county_number', sa.Text(), nullable=True),
    sa.Column('congressional_district_no', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('zips_grouped_historical_id')
    )
    op.create_index(op.f('ix_zips_grouped_historical_zip5'), 'zips_grouped_historical', ['zip5'], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_zips_grouped_historical_zip5'), table_name='zips_grouped_historical')
    op.drop_table('zips_grouped_historical')
    # ### end Alembic commands ###

