<reponame>AlonMaor14/anyway
"""cbs_modify_tables_and_add_dictionaries

Revision ID: 1c7c31b1c31d
Revises: 56b95d5826c
Create Date: 2018-09-30 01:10:18.193297

"""

# revision identifiers, used by Alembic.
revision = '1c7c31b1c31d'
down_revision = '56b95d5826c'
branch_labels = None
depends_on = None

import sqlalchemy as sa

from alembic import op


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('accident_hour_raw',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_hour_raw_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_hour_raw_id'), 'accident_hour_raw', ['id'], unique=False)
    op.create_table('accident_month',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_month_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_month_id'), 'accident_month', ['id'], unique=False)
    op.create_table('accident_severity',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_severity_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_severity_id'), 'accident_severity', ['id'], unique=False)
    op.create_table('accident_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_type_id'), 'accident_type', ['id'], unique=False)
    op.create_table('age_group',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('age_group_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_age_group_id'), 'age_group', ['id'], unique=False)
    op.create_table('columns_description',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('column_description', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_columns_description_id'), 'columns_description', ['id'], unique=False)
    op.create_table('cross_direction',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_direction_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_direction_id'), 'cross_direction', ['id'], unique=False)
    op.create_table('cross_location',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_location_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_location_id'), 'cross_location', ['id'], unique=False)
    op.create_table('cross_mode',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_mode_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_mode_id'), 'cross_mode', ['id'], unique=False)
    op.create_table('day_in_week',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_in_week_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_in_week_id'), 'day_in_week', ['id'], unique=False)
    op.create_table('day_night',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_night_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_night_id'), 'day_night', ['id'], unique=False)
    op.create_table('day_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_type_id'), 'day_type', ['id'], unique=False)
    op.create_table('didnt_cross',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('didnt_cross_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_didnt_cross_id'), 'didnt_cross', ['id'], unique=False)
    op.create_table('district',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('district_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_district_id'), 'district', ['id'], unique=False)
    op.create_table('driving_directions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('driving_directions_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_driving_directions_id'), 'driving_directions', ['id'], unique=False)
    op.create_table('engine_volume',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('engine_volume_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_engine_volume_id'), 'engine_volume', ['id'], unique=False)
    op.create_table('geo_area',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('geo_area_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_geo_area_id'), 'geo_area', ['id'], unique=False)
    op.create_table('hospital_time',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('hospital_time_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_hospital_time_id'), 'hospital_time', ['id'], unique=False)
    op.create_table('injured_position',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injured_position_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injured_position_id'), 'injured_position', ['id'], unique=False)
    op.create_table('injured_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injured_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injured_type_id'), 'injured_type', ['id'], unique=False)
    op.create_table('injury_severity',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injury_severity_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injury_severity_id'), 'injury_severity', ['id'], unique=False)
    op.create_table('involved_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('involved_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_involved_type_id'), 'involved_type', ['id'], unique=False)
    op.create_table('late_deceased',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('late_deceased_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_late_deceased_id'), 'late_deceased', ['id'], unique=False)
    op.create_table('location_accuracy',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('location_accuracy_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_location_accuracy_id'), 'location_accuracy', ['id'], unique=False)
    op.create_table('medical_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('medical_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_medical_type_id'), 'medical_type', ['id'], unique=False)
    op.create_table('minizipali_status',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('minizipali_status_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_minizipali_status_id'), 'minizipali_status', ['id'], unique=False)
    op.create_table('multi_lane',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('multi_lane_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_multi_lane_id'), 'multi_lane', ['id'], unique=False)
    op.create_table('natural_area',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('natural_area_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_natural_area_id'), 'natural_area', ['id'], unique=False)
    op.create_table('object_distance',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('object_distance_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_object_distance_id'), 'object_distance', ['id'], unique=False)
    op.create_table('one_lane',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('one_lane_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_one_lane_id'), 'one_lane', ['id'], unique=False)
    op.create_table('police_unit',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('police_unit_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_police_unit_id'), 'police_unit', ['id'], unique=False)
    op.create_table('population_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('population_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_population_type_id'), 'population_type', ['id'], unique=False)
    op.create_table('provider_code',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('provider_code_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_provider_code_id'), 'provider_code', ['id'], unique=False)
    op.create_table('region',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('region_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_region_id'), 'region', ['id'], unique=False)
    op.create_table('release_dest',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('release_dest_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_release_dest_id'), 'release_dest', ['id'], unique=False)
    op.create_table('road_control',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_control_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_control_id'), 'road_control', ['id'], unique=False)
    op.create_table('road_intactness',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_intactness_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_intactness_id'), 'road_intactness', ['id'], unique=False)
    op.create_table('road_light',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_light_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_light_id'), 'road_light', ['id'], unique=False)
    op.create_table('road_object',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_object_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_object_id'), 'road_object', ['id'], unique=False)
    op.create_table('road_shape',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_shape_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_shape_id'), 'road_shape', ['id'], unique=False)
    op.create_table('road_sign',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_sign_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_sign_id'), 'road_sign', ['id'], unique=False)
    op.create_table('road_surface',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_surface_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_surface_id'), 'road_surface', ['id'], unique=False)
    op.create_table('road_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_type_id'), 'road_type', ['id'], unique=False)
    op.create_table('road_width',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_width_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_width_id'), 'road_width', ['id'], unique=False)
    op.create_table('safety_measures',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('safety_measures_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_safety_measures_id'), 'safety_measures', ['id'], unique=False)
    op.create_table('safety_measures_use',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('safety_measures_use_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_safety_measures_use_id'), 'safety_measures_use', ['id'], unique=False)
    op.create_table('sex',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('sex_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_sex_id'), 'sex', ['id'], unique=False)
    op.create_table('speed_limit',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('speed_limit_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_speed_limit_id'), 'speed_limit', ['id'], unique=False)
    op.create_table('total_weight',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('total_weight_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_total_weight_id'), 'total_weight', ['id'], unique=False)
    op.create_table('traffic_light',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('traffic_light_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_traffic_light_id'), 'traffic_light', ['id'], unique=False)
    op.create_table('vehicle_attribution',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_attribution_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_attribution_id'), 'vehicle_attribution', ['id'], unique=False)
    op.create_table('vehicle_status',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_status_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_status_id'), 'vehicle_status', ['id'], unique=False)
    op.create_table('vehicle_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_type_id'), 'vehicle_type', ['id'], unique=False)
    op.create_table('weather',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('weather_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_weather_id'), 'weather', ['id'], unique=False)
    op.create_table('yishuv_shape',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('yishuv_shape_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_yishuv_shape_id'), 'yishuv_shape', ['id'], unique=False)
    op.add_column('markers', sa.Column('accident_severity', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('accident_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('day_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('location_accuracy', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('non_urban_intersection_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('police_unit', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_intactness', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_shape', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('street1_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('street2_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('yishuv_name', sa.Text(), nullable=True))
    op.drop_column('markers', 'roadShape')
    op.drop_column('markers', 'severity')
    op.drop_column('markers', 'intactness')
    op.drop_column('markers', 'subtype')
    op.drop_column('markers', 'roadType')
    op.drop_column('markers', 'dayType')
    op.drop_column('markers', 'locationAccuracy')
    op.drop_column('markers', 'unit')
    op.add_column('markers_no_location', sa.Column('accident_severity', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('accident_type', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('day_type', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('location_accuracy', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('police_unit', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_intactness', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_shape', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_type', sa.Integer(), nullable=True))
    op.drop_column('markers_no_location', 'roadShape')
    op.drop_column('markers_no_location', 'severity')
    op.drop_column('markers_no_location', 'intactness')
    op.drop_column('markers_no_location', 'subtype')
    op.drop_column('markers_no_location', 'roadType')
    op.drop_column('markers_no_location', 'dayType')
    op.drop_column('markers_no_location', 'locationAccuracy')
    op.drop_column('markers_no_location', 'unit')
    op.drop_index('idx_schools_geom', table_name='schools')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_index('idx_schools_geom', 'schools', ['geom'], unique=False)
    op.add_column('markers_no_location', sa.Column('unit', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location',
                  sa.Column('locationAccuracy', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('dayType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('roadType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('subtype', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('intactness', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('severity', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('roadShape', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers_no_location', 'road_type')
    op.drop_column('markers_no_location', 'road_shape')
    op.drop_column('markers_no_location', 'road_intactness')
    op.drop_column('markers_no_location', 'police_unit')
    op.drop_column('markers_no_location', 'location_accuracy')
    op.drop_column('markers_no_location', 'day_type')
    op.drop_column('markers_no_location', 'accident_type')
    op.drop_column('markers_no_location', 'accident_severity')
    op.add_column('markers', sa.Column('unit', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('locationAccuracy', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('dayType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('roadType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('subtype', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('intactness', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('severity', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('roadShape', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers', 'yishuv_name')
    op.drop_column('markers', 'street2_hebrew')
    op.drop_column('markers', 'street1_hebrew')
    op.drop_column('markers', 'road_type')
    op.drop_column('markers', 'road_shape')
    op.drop_column('markers', 'road_intactness')
    op.drop_column('markers', 'police_unit')
    op.drop_column('markers', 'non_urban_intersection_hebrew')
    op.drop_column('markers', 'location_accuracy')
    op.drop_column('markers', 'day_type')
    op.drop_column('markers', 'accident_type')
    op.drop_column('markers', 'accident_severity')
    op.drop_index(op.f('ix_yishuv_shape_id'), table_name='yishuv_shape')
    op.drop_table('yishuv_shape')
    op.drop_index(op.f('ix_weather_id'), table_name='weather')
    op.drop_table('weather')
    op.drop_index(op.f('ix_vehicle_type_id'), table_name='vehicle_type')
    op.drop_table('vehicle_type')
    op.drop_index(op.f('ix_vehicle_status_id'), table_name='vehicle_status')
    op.drop_table('vehicle_status')
    op.drop_index(op.f('ix_vehicle_attribution_id'), table_name='vehicle_attribution')
    op.drop_table('vehicle_attribution')
    op.drop_index(op.f('ix_traffic_light_id'), table_name='traffic_light')
    op.drop_table('traffic_light')
    op.drop_index(op.f('ix_total_weight_id'), table_name='total_weight')
    op.drop_table('total_weight')
    op.drop_index(op.f('ix_speed_limit_id'), table_name='speed_limit')
    op.drop_table('speed_limit')
    op.drop_index(op.f('ix_sex_id'), table_name='sex')
    op.drop_table('sex')
    op.drop_index(op.f('ix_safety_measures_use_id'), table_name='safety_measures_use')
    op.drop_table('safety_measures_use')
    op.drop_index(op.f('ix_safety_measures_id'), table_name='safety_measures')
    op.drop_table('safety_measures')
    op.drop_index(op.f('ix_road_width_id'), table_name='road_width')
    op.drop_table('road_width')
    op.drop_index(op.f('ix_road_type_id'), table_name='road_type')
    op.drop_table('road_type')
    op.drop_index(op.f('ix_road_surface_id'), table_name='road_surface')
    op.drop_table('road_surface')
    op.drop_index(op.f('ix_road_sign_id'), table_name='road_sign')
    op.drop_table('road_sign')
    op.drop_index(op.f('ix_road_shape_id'), table_name='road_shape')
    op.drop_table('road_shape')
    op.drop_index(op.f('ix_road_object_id'), table_name='road_object')
    op.drop_table('road_object')
    op.drop_index(op.f('ix_road_light_id'), table_name='road_light')
    op.drop_table('road_light')
    op.drop_index(op.f('ix_road_intactness_id'), table_name='road_intactness')
    op.drop_table('road_intactness')
    op.drop_index(op.f('ix_road_control_id'), table_name='road_control')
    op.drop_table('road_control')
    op.drop_index(op.f('ix_release_dest_id'), table_name='release_dest')
    op.drop_table('release_dest')
    op.drop_index(op.f('ix_region_id'), table_name='region')
    op.drop_table('region')
    op.drop_index(op.f('ix_provider_code_id'), table_name='provider_code')
    op.drop_table('provider_code')
    op.drop_index(op.f('ix_population_type_id'), table_name='population_type')
    op.drop_table('population_type')
    op.drop_index(op.f('ix_police_unit_id'), table_name='police_unit')
    op.drop_table('police_unit')
    op.drop_index(op.f('ix_one_lane_id'), table_name='one_lane')
    op.drop_table('one_lane')
    op.drop_index(op.f('ix_object_distance_id'), table_name='object_distance')
    op.drop_table('object_distance')
    op.drop_index(op.f('ix_natural_area_id'), table_name='natural_area')
    op.drop_table('natural_area')
    op.drop_index(op.f('ix_multi_lane_id'), table_name='multi_lane')
    op.drop_table('multi_lane')
    op.drop_index(op.f('ix_minizipali_status_id'), table_name='minizipali_status')
    op.drop_table('minizipali_status')
    op.drop_index(op.f('ix_medical_type_id'), table_name='medical_type')
    op.drop_table('medical_type')
    op.drop_index(op.f('ix_location_accuracy_id'), table_name='location_accuracy')
    op.drop_table('location_accuracy')
    op.drop_index(op.f('ix_late_deceased_id'), table_name='late_deceased')
    op.drop_table('late_deceased')
    op.drop_index(op.f('ix_involved_type_id'), table_name='involved_type')
    op.drop_table('involved_type')
    op.drop_index(op.f('ix_injury_severity_id'), table_name='injury_severity')
    op.drop_table('injury_severity')
    op.drop_index(op.f('ix_injured_type_id'), table_name='injured_type')
    op.drop_table('injured_type')
    op.drop_index(op.f('ix_injured_position_id'), table_name='injured_position')
    op.drop_table('injured_position')
    op.drop_index(op.f('ix_hospital_time_id'), table_name='hospital_time')
    op.drop_table('hospital_time')
    op.drop_index(op.f('ix_geo_area_id'), table_name='geo_area')
    op.drop_table('geo_area')
    op.drop_index(op.f('ix_engine_volume_id'), table_name='engine_volume')
    op.drop_table('engine_volume')
    op.drop_index(op.f('ix_driving_directions_id'), table_name='driving_directions')
    op.drop_table('driving_directions')
    op.drop_index(op.f('ix_district_id'), table_name='district')
    op.drop_table('district')
    op.drop_index(op.f('ix_didnt_cross_id'), table_name='didnt_cross')
    op.drop_table('didnt_cross')
    op.drop_index(op.f('ix_day_type_id'), table_name='day_type')
    op.drop_table('day_type')
    op.drop_index(op.f('ix_day_night_id'), table_name='day_night')
    op.drop_table('day_night')
    op.drop_index(op.f('ix_day_in_week_id'), table_name='day_in_week')
    op.drop_table('day_in_week')
    op.drop_index(op.f('ix_cross_mode_id'), table_name='cross_mode')
    op.drop_table('cross_mode')
    op.drop_index(op.f('ix_cross_location_id'), table_name='cross_location')
    op.drop_table('cross_location')
    op.drop_index(op.f('ix_cross_direction_id'), table_name='cross_direction')
    op.drop_table('cross_direction')
    op.drop_index(op.f('ix_columns_description_id'), table_name='columns_description')
    op.drop_table('columns_description')
    op.drop_index(op.f('ix_age_group_id'), table_name='age_group')
    op.drop_table('age_group')
    op.drop_index(op.f('ix_accident_type_id'), table_name='accident_type')
    op.drop_table('accident_type')
    op.drop_index(op.f('ix_accident_severity_id'), table_name='accident_severity')
    op.drop_table('accident_severity')
    op.drop_index(op.f('ix_accident_month_id'), table_name='accident_month')
    op.drop_table('accident_month')
    op.drop_index(op.f('ix_accident_hour_raw_id'), table_name='accident_hour_raw')
    op.drop_table('accident_hour_raw')
    ### end Alembic commands ###

"""cbs_modify_tables_and_add_dictionaries

Revision ID: 1c7c31b1c31d
Revises: 56b95d5826c
Create Date: 2018-09-30 01:10:18.193297

"""

# revision identifiers, used by Alembic.
revision = '1c7c31b1c31d'
down_revision = '56b95d5826c'
branch_labels = None
depends_on = None

import sqlalchemy as sa

from alembic import op


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('accident_hour_raw',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_hour_raw_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_hour_raw_id'), 'accident_hour_raw', ['id'], unique=False)
    op.create_table('accident_month',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_month_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_month_id'), 'accident_month', ['id'], unique=False)
    op.create_table('accident_severity',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_severity_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_severity_id'), 'accident_severity', ['id'], unique=False)
    op.create_table('accident_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('accident_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_accident_type_id'), 'accident_type', ['id'], unique=False)
    op.create_table('age_group',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('age_group_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_age_group_id'), 'age_group', ['id'], unique=False)
    op.create_table('columns_description',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('column_description', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_columns_description_id'), 'columns_description', ['id'], unique=False)
    op.create_table('cross_direction',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_direction_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_direction_id'), 'cross_direction', ['id'], unique=False)
    op.create_table('cross_location',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_location_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_location_id'), 'cross_location', ['id'], unique=False)
    op.create_table('cross_mode',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('cross_mode_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_cross_mode_id'), 'cross_mode', ['id'], unique=False)
    op.create_table('day_in_week',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_in_week_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_in_week_id'), 'day_in_week', ['id'], unique=False)
    op.create_table('day_night',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_night_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_night_id'), 'day_night', ['id'], unique=False)
    op.create_table('day_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('day_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_day_type_id'), 'day_type', ['id'], unique=False)
    op.create_table('didnt_cross',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('didnt_cross_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_didnt_cross_id'), 'didnt_cross', ['id'], unique=False)
    op.create_table('district',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('district_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_district_id'), 'district', ['id'], unique=False)
    op.create_table('driving_directions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('driving_directions_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_driving_directions_id'), 'driving_directions', ['id'], unique=False)
    op.create_table('engine_volume',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('engine_volume_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_engine_volume_id'), 'engine_volume', ['id'], unique=False)
    op.create_table('geo_area',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('geo_area_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_geo_area_id'), 'geo_area', ['id'], unique=False)
    op.create_table('hospital_time',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('hospital_time_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_hospital_time_id'), 'hospital_time', ['id'], unique=False)
    op.create_table('injured_position',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injured_position_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injured_position_id'), 'injured_position', ['id'], unique=False)
    op.create_table('injured_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injured_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injured_type_id'), 'injured_type', ['id'], unique=False)
    op.create_table('injury_severity',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('injury_severity_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_injury_severity_id'), 'injury_severity', ['id'], unique=False)
    op.create_table('involved_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('involved_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_involved_type_id'), 'involved_type', ['id'], unique=False)
    op.create_table('late_deceased',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('late_deceased_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_late_deceased_id'), 'late_deceased', ['id'], unique=False)
    op.create_table('location_accuracy',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('location_accuracy_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_location_accuracy_id'), 'location_accuracy', ['id'], unique=False)
    op.create_table('medical_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('medical_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_medical_type_id'), 'medical_type', ['id'], unique=False)
    op.create_table('minizipali_status',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('minizipali_status_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_minizipali_status_id'), 'minizipali_status', ['id'], unique=False)
    op.create_table('multi_lane',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('multi_lane_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_multi_lane_id'), 'multi_lane', ['id'], unique=False)
    op.create_table('natural_area',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('natural_area_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_natural_area_id'), 'natural_area', ['id'], unique=False)
    op.create_table('object_distance',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('object_distance_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_object_distance_id'), 'object_distance', ['id'], unique=False)
    op.create_table('one_lane',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('one_lane_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_one_lane_id'), 'one_lane', ['id'], unique=False)
    op.create_table('police_unit',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('police_unit_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_police_unit_id'), 'police_unit', ['id'], unique=False)
    op.create_table('population_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('population_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_population_type_id'), 'population_type', ['id'], unique=False)
    op.create_table('provider_code',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('provider_code_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_provider_code_id'), 'provider_code', ['id'], unique=False)
    op.create_table('region',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('region_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_region_id'), 'region', ['id'], unique=False)
    op.create_table('release_dest',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('release_dest_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_release_dest_id'), 'release_dest', ['id'], unique=False)
    op.create_table('road_control',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_control_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_control_id'), 'road_control', ['id'], unique=False)
    op.create_table('road_intactness',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_intactness_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_intactness_id'), 'road_intactness', ['id'], unique=False)
    op.create_table('road_light',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_light_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_light_id'), 'road_light', ['id'], unique=False)
    op.create_table('road_object',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_object_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_object_id'), 'road_object', ['id'], unique=False)
    op.create_table('road_shape',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_shape_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_shape_id'), 'road_shape', ['id'], unique=False)
    op.create_table('road_sign',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_sign_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_sign_id'), 'road_sign', ['id'], unique=False)
    op.create_table('road_surface',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_surface_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_surface_id'), 'road_surface', ['id'], unique=False)
    op.create_table('road_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_type_id'), 'road_type', ['id'], unique=False)
    op.create_table('road_width',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('road_width_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_road_width_id'), 'road_width', ['id'], unique=False)
    op.create_table('safety_measures',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('safety_measures_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_safety_measures_id'), 'safety_measures', ['id'], unique=False)
    op.create_table('safety_measures_use',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('safety_measures_use_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_safety_measures_use_id'), 'safety_measures_use', ['id'], unique=False)
    op.create_table('sex',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('sex_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_sex_id'), 'sex', ['id'], unique=False)
    op.create_table('speed_limit',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('speed_limit_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_speed_limit_id'), 'speed_limit', ['id'], unique=False)
    op.create_table('total_weight',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('total_weight_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_total_weight_id'), 'total_weight', ['id'], unique=False)
    op.create_table('traffic_light',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('traffic_light_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_traffic_light_id'), 'traffic_light', ['id'], unique=False)
    op.create_table('vehicle_attribution',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_attribution_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_attribution_id'), 'vehicle_attribution', ['id'], unique=False)
    op.create_table('vehicle_status',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_status_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_status_id'), 'vehicle_status', ['id'], unique=False)
    op.create_table('vehicle_type',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('vehicle_type_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_vehicle_type_id'), 'vehicle_type', ['id'], unique=False)
    op.create_table('weather',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('weather_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_weather_id'), 'weather', ['id'], unique=False)
    op.create_table('yishuv_shape',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('yishuv_shape_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_yishuv_shape_id'), 'yishuv_shape', ['id'], unique=False)
    op.add_column('markers', sa.Column('accident_severity', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('accident_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('day_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('location_accuracy', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('non_urban_intersection_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('police_unit', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_intactness', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_shape', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('road_type', sa.Integer(), nullable=True))
    op.add_column('markers', sa.Column('street1_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('street2_hebrew', sa.Text(), nullable=True))
    op.add_column('markers', sa.Column('yishuv_name', sa.Text(), nullable=True))
    op.drop_column('markers', 'roadShape')
    op.drop_column('markers', 'severity')
    op.drop_column('markers', 'intactness')
    op.drop_column('markers', 'subtype')
    op.drop_column('markers', 'roadType')
    op.drop_column('markers', 'dayType')
    op.drop_column('markers', 'locationAccuracy')
    op.drop_column('markers', 'unit')
    op.add_column('markers_no_location', sa.Column('accident_severity', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('accident_type', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('day_type', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('location_accuracy', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('police_unit', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_intactness', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_shape', sa.Integer(), nullable=True))
    op.add_column('markers_no_location', sa.Column('road_type', sa.Integer(), nullable=True))
    op.drop_column('markers_no_location', 'roadShape')
    op.drop_column('markers_no_location', 'severity')
    op.drop_column('markers_no_location', 'intactness')
    op.drop_column('markers_no_location', 'subtype')
    op.drop_column('markers_no_location', 'roadType')
    op.drop_column('markers_no_location', 'dayType')
    op.drop_column('markers_no_location', 'locationAccuracy')
    op.drop_column('markers_no_location', 'unit')
    op.drop_index('idx_schools_geom', table_name='schools')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_index('idx_schools_geom', 'schools', ['geom'], unique=False)
    op.add_column('markers_no_location', sa.Column('unit', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location',
                  sa.Column('locationAccuracy', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('dayType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('roadType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('subtype', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('intactness', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('severity', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers_no_location', sa.Column('roadShape', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers_no_location', 'road_type')
    op.drop_column('markers_no_location', 'road_shape')
    op.drop_column('markers_no_location', 'road_intactness')
    op.drop_column('markers_no_location', 'police_unit')
    op.drop_column('markers_no_location', 'location_accuracy')
    op.drop_column('markers_no_location', 'day_type')
    op.drop_column('markers_no_location', 'accident_type')
    op.drop_column('markers_no_location', 'accident_severity')
    op.add_column('markers', sa.Column('unit', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('locationAccuracy', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('dayType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('roadType', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('subtype', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('intactness', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('severity', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('markers', sa.Column('roadShape', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers', 'yishuv_name')
    op.drop_column('markers', 'street2_hebrew')
    op.drop_column('markers', 'street1_hebrew')
    op.drop_column('markers', 'road_type')
    op.drop_column('markers', 'road_shape')
    op.drop_column('markers', 'road_intactness')
    op.drop_column('markers', 'police_unit')
    op.drop_column('markers', 'non_urban_intersection_hebrew')
    op.drop_column('markers', 'location_accuracy')
    op.drop_column('markers', 'day_type')
    op.drop_column('markers', 'accident_type')
    op.drop_column('markers', 'accident_severity')
    op.drop_index(op.f('ix_yishuv_shape_id'), table_name='yishuv_shape')
    op.drop_table('yishuv_shape')
    op.drop_index(op.f('ix_weather_id'), table_name='weather')
    op.drop_table('weather')
    op.drop_index(op.f('ix_vehicle_type_id'), table_name='vehicle_type')
    op.drop_table('vehicle_type')
    op.drop_index(op.f('ix_vehicle_status_id'), table_name='vehicle_status')
    op.drop_table('vehicle_status')
    op.drop_index(op.f('ix_vehicle_attribution_id'), table_name='vehicle_attribution')
    op.drop_table('vehicle_attribution')
    op.drop_index(op.f('ix_traffic_light_id'), table_name='traffic_light')
    op.drop_table('traffic_light')
    op.drop_index(op.f('ix_total_weight_id'), table_name='total_weight')
    op.drop_table('total_weight')
    op.drop_index(op.f('ix_speed_limit_id'), table_name='speed_limit')
    op.drop_table('speed_limit')
    op.drop_index(op.f('ix_sex_id'), table_name='sex')
    op.drop_table('sex')
    op.drop_index(op.f('ix_safety_measures_use_id'), table_name='safety_measures_use')
    op.drop_table('safety_measures_use')
    op.drop_index(op.f('ix_safety_measures_id'), table_name='safety_measures')
    op.drop_table('safety_measures')
    op.drop_index(op.f('ix_road_width_id'), table_name='road_width')
    op.drop_table('road_width')
    op.drop_index(op.f('ix_road_type_id'), table_name='road_type')
    op.drop_table('road_type')
    op.drop_index(op.f('ix_road_surface_id'), table_name='road_surface')
    op.drop_table('road_surface')
    op.drop_index(op.f('ix_road_sign_id'), table_name='road_sign')
    op.drop_table('road_sign')
    op.drop_index(op.f('ix_road_shape_id'), table_name='road_shape')
    op.drop_table('road_shape')
    op.drop_index(op.f('ix_road_object_id'), table_name='road_object')
    op.drop_table('road_object')
    op.drop_index(op.f('ix_road_light_id'), table_name='road_light')
    op.drop_table('road_light')
    op.drop_index(op.f('ix_road_intactness_id'), table_name='road_intactness')
    op.drop_table('road_intactness')
    op.drop_index(op.f('ix_road_control_id'), table_name='road_control')
    op.drop_table('road_control')
    op.drop_index(op.f('ix_release_dest_id'), table_name='release_dest')
    op.drop_table('release_dest')
    op.drop_index(op.f('ix_region_id'), table_name='region')
    op.drop_table('region')
    op.drop_index(op.f('ix_provider_code_id'), table_name='provider_code')
    op.drop_table('provider_code')
    op.drop_index(op.f('ix_population_type_id'), table_name='population_type')
    op.drop_table('population_type')
    op.drop_index(op.f('ix_police_unit_id'), table_name='police_unit')
    op.drop_table('police_unit')
    op.drop_index(op.f('ix_one_lane_id'), table_name='one_lane')
    op.drop_table('one_lane')
    op.drop_index(op.f('ix_object_distance_id'), table_name='object_distance')
    op.drop_table('object_distance')
    op.drop_index(op.f('ix_natural_area_id'), table_name='natural_area')
    op.drop_table('natural_area')
    op.drop_index(op.f('ix_multi_lane_id'), table_name='multi_lane')
    op.drop_table('multi_lane')
    op.drop_index(op.f('ix_minizipali_status_id'), table_name='minizipali_status')
    op.drop_table('minizipali_status')
    op.drop_index(op.f('ix_medical_type_id'), table_name='medical_type')
    op.drop_table('medical_type')
    op.drop_index(op.f('ix_location_accuracy_id'), table_name='location_accuracy')
    op.drop_table('location_accuracy')
    op.drop_index(op.f('ix_late_deceased_id'), table_name='late_deceased')
    op.drop_table('late_deceased')
    op.drop_index(op.f('ix_involved_type_id'), table_name='involved_type')
    op.drop_table('involved_type')
    op.drop_index(op.f('ix_injury_severity_id'), table_name='injury_severity')
    op.drop_table('injury_severity')
    op.drop_index(op.f('ix_injured_type_id'), table_name='injured_type')
    op.drop_table('injured_type')
    op.drop_index(op.f('ix_injured_position_id'), table_name='injured_position')
    op.drop_table('injured_position')
    op.drop_index(op.f('ix_hospital_time_id'), table_name='hospital_time')
    op.drop_table('hospital_time')
    op.drop_index(op.f('ix_geo_area_id'), table_name='geo_area')
    op.drop_table('geo_area')
    op.drop_index(op.f('ix_engine_volume_id'), table_name='engine_volume')
    op.drop_table('engine_volume')
    op.drop_index(op.f('ix_driving_directions_id'), table_name='driving_directions')
    op.drop_table('driving_directions')
    op.drop_index(op.f('ix_district_id'), table_name='district')
    op.drop_table('district')
    op.drop_index(op.f('ix_didnt_cross_id'), table_name='didnt_cross')
    op.drop_table('didnt_cross')
    op.drop_index(op.f('ix_day_type_id'), table_name='day_type')
    op.drop_table('day_type')
    op.drop_index(op.f('ix_day_night_id'), table_name='day_night')
    op.drop_table('day_night')
    op.drop_index(op.f('ix_day_in_week_id'), table_name='day_in_week')
    op.drop_table('day_in_week')
    op.drop_index(op.f('ix_cross_mode_id'), table_name='cross_mode')
    op.drop_table('cross_mode')
    op.drop_index(op.f('ix_cross_location_id'), table_name='cross_location')
    op.drop_table('cross_location')
    op.drop_index(op.f('ix_cross_direction_id'), table_name='cross_direction')
    op.drop_table('cross_direction')
    op.drop_index(op.f('ix_columns_description_id'), table_name='columns_description')
    op.drop_table('columns_description')
    op.drop_index(op.f('ix_age_group_id'), table_name='age_group')
    op.drop_table('age_group')
    op.drop_index(op.f('ix_accident_type_id'), table_name='accident_type')
    op.drop_table('accident_type')
    op.drop_index(op.f('ix_accident_severity_id'), table_name='accident_severity')
    op.drop_table('accident_severity')
    op.drop_index(op.f('ix_accident_month_id'), table_name='accident_month')
    op.drop_table('accident_month')
    op.drop_index(op.f('ix_accident_hour_raw_id'), table_name='accident_hour_raw')
    op.drop_table('accident_hour_raw')
    ### end Alembic commands ###
cbs_modify_tables_and_add_dictionaries  Revision ID: 1c7c31b1c31d Revises: 56b95d5826c Create Date: 2018-09-30 01:10:18.193297 # revision identifiers, used by Alembic. ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ###