From f56dbb3e566f606456ec6ce379ca13fc729297ad Mon Sep 17 00:00:00 2001 From: K Agajanian Date: Thu, 5 Sep 2024 15:27:09 -0400 Subject: [PATCH] hell yeah --- migrations/env.py | 18 + migrations/versions/2024_08_09_test_1.py | 1434 ---------------------- migrations/versions/__init__.py | 0 3 files changed, 18 insertions(+), 1434 deletions(-) delete mode 100644 migrations/versions/2024_08_09_test_1.py delete mode 100644 migrations/versions/__init__.py diff --git a/migrations/env.py b/migrations/env.py index dfbce59..30834d5 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -41,6 +41,23 @@ def process_revision_directives(context, revision, directives): script.imports.add("import geoalchemy2") +def include_object(obj, name, type_, reflected, compare_to): + """ + Good bot generated a docstring: + Custom function to include/exclude objects in Alembic autogenerate. + + :param obj: SQLAlchemy object being considered (table, column, etc.) + :param name: Name of the object + :param type_: Type of object ('table', 'column', etc.) + :param reflected: True if the object is reflected from the database + :param compare_to: The corresponding object to compare against + :return: True if the object should be included in autogenerate, False to exclude + """ + if type_ == "table" and name == "spatial_ref_sys": + return False + return True + + def run_migrations_offline() -> None: """Run migrations in 'offline' mode. @@ -80,6 +97,7 @@ def run_migrations_online() -> None: connection=connection, target_metadata=target_metadata, process_revision_directives=process_revision_directives, # Make sure geoalchemy import included with any autogen script + include_object=include_object, ) for schema in SCHEMATA: diff --git a/migrations/versions/2024_08_09_test_1.py b/migrations/versions/2024_08_09_test_1.py deleted file mode 100644 index 78ba30d..0000000 --- a/migrations/versions/2024_08_09_test_1.py +++ /dev/null @@ -1,1434 +0,0 @@ -"""test_1 - -Revision ID: 87047362a923 -Revises: -Create Date: 2024-08-09 15:49:04.639142 - -""" - -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import postgresql - -import geoalchemy2 - -# revision identifiers, used by Alembic. -revision: str = "87047362a923" -down_revision: Union[str, None] = None -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "feed_item", - sa.Column("name", sa.String(), nullable=True), - sa.Column("id", sa.UUID(), nullable=False), - sa.Column("create_time", sa.TIMESTAMP(), nullable=True), - sa.Column("updated_time", sa.TIMESTAMP(), nullable=True), - sa.PrimaryKeyConstraint("id"), - schema="gps", - ) - op.create_index( - op.f("ix_gps_feed_item_id"), "feed_item", ["id"], unique=False, schema="gps" - ) - op.create_table( - "trajectory", - sa.Column( - "geom", - geoalchemy2.types.Geometry( - geometry_type="GEOMETRYZM", - from_text="ST_GeomFromEWKT", - name="geometry", - spatial_index=False, - ), - nullable=True, - ), - sa.Column("feed_item_id", sa.UUID(), nullable=True), - sa.Column("id", sa.UUID(), nullable=False), - sa.Column("create_time", sa.TIMESTAMP(), nullable=True), - sa.Column("updated_time", sa.TIMESTAMP(), nullable=True), - sa.ForeignKeyConstraint( - ["feed_item_id"], - ["gps.feed_item.id"], - ), - sa.PrimaryKeyConstraint("id"), - schema="gps", - ) - op.create_index( - "idx_trajectory_geom", - "trajectory", - ["geom"], - unique=False, - schema="gps", - postgresql_using="gist", - ) - op.create_index( - op.f("ix_gps_trajectory_id"), "trajectory", ["id"], unique=False, schema="gps" - ) - # op.drop_table("geocode_settings") - # op.drop_index("place_lookup_name_idx", table_name="place_lookup") - # op.drop_index("place_lookup_state_idx", table_name="place_lookup") - # op.drop_table("place_lookup") - # op.drop_index( - # "idx_addrfeat_geom_gist", table_name="addrfeat", postgresql_using="gist" - # ) - # op.drop_index("idx_addrfeat_tlid", table_name="addrfeat") - # op.drop_index("idx_addrfeat_zipl", table_name="addrfeat") - # op.drop_index("idx_addrfeat_zipr", table_name="addrfeat") - # op.drop_table("addrfeat") - # op.drop_table("zip_lookup_base") - # op.drop_index( - # "idx_tiger_state_the_geom_gist", table_name="state", postgresql_using="gist" - # ) - # op.drop_table("state") - # op.drop_index("idx_edges_tlid", table_name="edges") - # op.drop_index("idx_tiger_edges_countyfp", table_name="edges") - # op.drop_index( - # "idx_tiger_edges_the_geom_gist", table_name="edges", postgresql_using="gist" - # ) - # op.drop_table("edges") - # op.drop_index("direction_lookup_abbrev_idx", table_name="direction_lookup") - # op.drop_table("direction_lookup") - # op.drop_index( - # "tiger_place_the_geom_gist", table_name="place", postgresql_using="gist" - # ) - # op.drop_table("place") - # op.drop_table("spatial_ref_sys") - # op.drop_table("bg") - # op.drop_index( - # "secondary_unit_lookup_abbrev_idx", table_name="secondary_unit_lookup" - # ) - # op.drop_table("secondary_unit_lookup") - # op.drop_table("pagc_lex") - # op.drop_table("zcta5") - # op.drop_index("idx_tiger_faces_countyfp", table_name="faces") - # op.drop_index("idx_tiger_faces_tfid", table_name="faces") - # op.drop_index( - # "tiger_faces_the_geom_gist", table_name="faces", postgresql_using="gist" - # ) - # op.drop_table("faces") - # op.drop_table("tabblock") - # op.drop_table("state_lookup") - # op.drop_table("geocode_settings_default") - # op.drop_table("topology") - # op.drop_table("tract") - # op.drop_index("county_lookup_name_idx", table_name="county_lookup") - # op.drop_index("county_lookup_state_idx", table_name="county_lookup") - # op.drop_table("county_lookup") - # op.drop_index("idx_tiger_featnames_lname", table_name="featnames") - # op.drop_index("idx_tiger_featnames_snd_name", table_name="featnames") - # op.drop_index("idx_tiger_featnames_tlid_statefp", table_name="featnames") - # op.drop_table("featnames") - # op.drop_table("layer") - # op.drop_table("pagc_gaz") - # op.drop_index("street_type_lookup_abbrev_idx", table_name="street_type_lookup") - # op.drop_table("street_type_lookup") - # op.drop_index("idx_tiger_county", table_name="county") - # op.drop_table("county") - # op.drop_index("countysub_lookup_name_idx", table_name="countysub_lookup") - # op.drop_index("countysub_lookup_state_idx", table_name="countysub_lookup") - # op.drop_table("countysub_lookup") - # op.drop_table("zip_lookup") - # op.drop_table("loader_lookuptables") - # op.drop_index( - # "tige_cousub_the_geom_gist", table_name="cousub", postgresql_using="gist" - # ) - # op.drop_table("cousub") - # op.drop_index("idx_tiger_addr_tlid_statefp", table_name="addr") - # op.drop_index("idx_tiger_addr_zip", table_name="addr") - # op.drop_table("addr") - # op.drop_table("zip_state") - # op.drop_table("pagc_rules") - # op.drop_table("tabblock20") - # op.drop_table("zip_lookup_all") - # op.drop_table("zip_state_loc") - # op.drop_table("loader_variables") - # op.drop_table("loader_platform") - # # ### end Alembic commands ### - - -def downgrade() -> None: - pass - # # ### commands auto generated by Alembic - please adjust! ### - # op.create_table( - # "loader_platform", - # sa.Column("os", sa.VARCHAR(length=50), autoincrement=False, nullable=False), - # sa.Column("declare_sect", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("pgbin", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("wget", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("unzip_command", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("psql", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("path_sep", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("loader", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("environ_set_command", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column( - # "county_process_command", sa.TEXT(), autoincrement=False, nullable=True - # ), - # sa.PrimaryKeyConstraint("os", name="loader_platform_pkey"), - # ) - # op.create_table( - # "loader_variables", - # sa.Column( - # "tiger_year", sa.VARCHAR(length=4), autoincrement=False, nullable=False - # ), - # sa.Column("website_root", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("staging_fold", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("data_schema", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("staging_schema", sa.TEXT(), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("tiger_year", name="loader_variables_pkey"), - # ) - # op.create_table( - # "zip_state_loc", - # sa.Column("zip", sa.VARCHAR(length=5), autoincrement=False, nullable=False), - # sa.Column("stusps", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("place", sa.VARCHAR(length=100), autoincrement=False, nullable=False), - # sa.PrimaryKeyConstraint("zip", "stusps", "place", name="zip_state_loc_pkey"), - # ) - # op.create_table( - # "zip_lookup_all", - # sa.Column("zip", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("state", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("co_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("county", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("cs_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("cousub", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("pl_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("place", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("cnt", sa.INTEGER(), autoincrement=False, nullable=True), - # ) - # op.create_table( - # "tabblock20", - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("blockce", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("geoid", sa.VARCHAR(length=15), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=10), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("ur", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("uace", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("uatype", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # geometry_type="MULTIPOLYGON", - # srid=4269, - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "housing", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "pop", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True - # ), - # sa.PrimaryKeyConstraint("geoid", name="pk_tabblock20"), - # ) - # op.create_table( - # "pagc_rules", - # sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("rule", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column( - # "is_custom", - # sa.BOOLEAN(), - # server_default=sa.text("true"), - # autoincrement=False, - # nullable=True, - # ), - # sa.PrimaryKeyConstraint("id", name="pagc_rules_pkey"), - # ) - # op.create_table( - # "zip_state", - # sa.Column("zip", sa.VARCHAR(length=5), autoincrement=False, nullable=False), - # sa.Column("stusps", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("zip", "stusps", name="zip_state_pkey"), - # ) - # op.create_table( - # "addr", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("tlid", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column("fromhn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("tohn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("side", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("zip", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("plus4", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("fromtyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("totyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("fromarmid", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("toarmid", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("arid", sa.VARCHAR(length=22), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("gid", name="addr_pkey"), - # ) - # op.create_index("idx_tiger_addr_zip", "addr", ["zip"], unique=False) - # op.create_index( - # "idx_tiger_addr_tlid_statefp", "addr", ["tlid", "statefp"], unique=False - # ) - # op.create_table( - # "cousub", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("cousubfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("cousubns", sa.VARCHAR(length=8), autoincrement=False, nullable=True), - # sa.Column( - # "cosbidfp", sa.VARCHAR(length=10), autoincrement=False, nullable=False - # ), - # sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), - # sa.Column( - # "namelsad", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("lsad", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("classfp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("cnectafp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("nectafp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("nctadvfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.NUMERIC(precision=14, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.NUMERIC(precision=14, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("cosbidfp", name="cousub_pkey"), - # sa.UniqueConstraint("gid", name="uidx_cousub_gid"), - # ) - # op.create_index( - # "tige_cousub_the_geom_gist", - # "cousub", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_table( - # "loader_lookuptables", - # sa.Column( - # "process_order", - # sa.INTEGER(), - # server_default=sa.text("1000"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column( - # "lookup_name", - # sa.TEXT(), - # autoincrement=False, - # nullable=False, - # comment="This is the table name to inherit from and suffix of resulting output table -- how the table will be named -- edges here would mean -- ma_edges , pa_edges etc. except in the case of national tables. national level tables have no prefix", - # ), - # sa.Column( - # "table_name", - # sa.TEXT(), - # autoincrement=False, - # nullable=True, - # comment="suffix of the tables to load e.g. edges would load all tables like *edges.dbf(shp) -- so tl_2010_42129_edges.dbf . ", - # ), - # sa.Column( - # "single_mode", - # sa.BOOLEAN(), - # server_default=sa.text("true"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column( - # "load", - # sa.BOOLEAN(), - # server_default=sa.text("true"), - # autoincrement=False, - # nullable=False, - # comment="Whether or not to load the table. For states and zcta5 (you may just want to download states10, zcta510 nationwide file manually) load your own into a single table that inherits from tiger.states, tiger.zcta5. You'll get improved performance for some geocoding cases.", - # ), - # sa.Column( - # "level_county", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column( - # "level_state", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column( - # "level_nation", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=False, - # comment="These are tables that contain all data for the whole US so there is just a single file", - # ), - # sa.Column("post_load_process", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column( - # "single_geom_mode", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "insert_mode", - # sa.CHAR(length=1), - # server_default=sa.text("'c'::bpchar"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column("pre_load_process", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column( - # "columns_exclude", - # postgresql.ARRAY(sa.TEXT()), - # autoincrement=False, - # nullable=True, - # comment="List of columns to exclude as an array. This is excluded from both input table and output table and rest of columns remaining are assumed to be in same order in both tables. gid, geoid,cpi,suffix1ce are excluded if no columns are specified.", - # ), - # sa.Column( - # "website_root_override", - # sa.TEXT(), - # autoincrement=False, - # nullable=True, - # comment="Path to use for wget instead of that specified in year table. Needed currently for zcta where they release that only for 2000 and 2010", - # ), - # sa.PrimaryKeyConstraint("lookup_name", name="loader_lookuptables_pkey"), - # ) - # op.create_table( - # "zip_lookup", - # sa.Column("zip", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("state", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("co_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("county", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("cs_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("cousub", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("pl_code", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("place", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("cnt", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("zip", name="zip_lookup_pkey"), - # ) - # op.create_table( - # "countysub_lookup", - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("state", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("co_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("county", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("cs_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint( - # "st_code", "co_code", "cs_code", name="countysub_lookup_pkey" - # ), - # ) - # op.create_index( - # "countysub_lookup_state_idx", "countysub_lookup", ["state"], unique=False - # ) - # op.create_index( - # "countysub_lookup_name_idx", - # "countysub_lookup", - # [sa.text("soundex(name::text)")], - # unique=False, - # ) - # op.create_table( - # "county", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("countyns", sa.VARCHAR(length=8), autoincrement=False, nullable=True), - # sa.Column( - # "cntyidfp", sa.VARCHAR(length=5), autoincrement=False, nullable=False - # ), - # sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), - # sa.Column( - # "namelsad", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("lsad", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("classfp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("csafp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("cbsafp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("metdivfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("aland", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_geom"), - # sa.PrimaryKeyConstraint("cntyidfp", name="pk_tiger_county"), - # sa.UniqueConstraint("gid", name="uidx_county_gid"), - # ) - # op.create_index("idx_tiger_county", "county", ["countyfp"], unique=False) - # op.create_table( - # "street_type_lookup", - # sa.Column("name", sa.VARCHAR(length=50), autoincrement=False, nullable=False), - # sa.Column("abbrev", sa.VARCHAR(length=50), autoincrement=False, nullable=True), - # sa.Column( - # "is_hw", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=False, - # ), - # sa.PrimaryKeyConstraint("name", name="street_type_lookup_pkey"), - # ) - # op.create_index( - # "street_type_lookup_abbrev_idx", "street_type_lookup", ["abbrev"], unique=False - # ) - # op.create_table( - # "pagc_gaz", - # sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("seq", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("word", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("stdword", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("token", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column( - # "is_custom", - # sa.BOOLEAN(), - # server_default=sa.text("true"), - # autoincrement=False, - # nullable=False, - # ), - # sa.PrimaryKeyConstraint("id", name="pagc_gaz_pkey"), - # ) - # op.create_table( - # "layer", - # sa.Column("topology_id", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("layer_id", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("schema_name", sa.VARCHAR(), autoincrement=False, nullable=False), - # sa.Column("table_name", sa.VARCHAR(), autoincrement=False, nullable=False), - # sa.Column("feature_column", sa.VARCHAR(), autoincrement=False, nullable=False), - # sa.Column("feature_type", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column( - # "level", - # sa.INTEGER(), - # server_default=sa.text("0"), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column("child_id", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.ForeignKeyConstraint( - # ["topology_id"], ["topology.id"], name="layer_topology_id_fkey" - # ), - # sa.PrimaryKeyConstraint("topology_id", "layer_id", name="layer_pkey"), - # sa.UniqueConstraint( - # "schema_name", - # "table_name", - # "feature_column", - # name="layer_schema_name_table_name_feature_column_key", - # ), - # ) - # op.create_table( - # "featnames", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("tlid", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column( - # "fullname", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), - # sa.Column( - # "predirabrv", sa.VARCHAR(length=15), autoincrement=False, nullable=True - # ), - # sa.Column( - # "pretypabrv", sa.VARCHAR(length=50), autoincrement=False, nullable=True - # ), - # sa.Column( - # "prequalabr", sa.VARCHAR(length=15), autoincrement=False, nullable=True - # ), - # sa.Column( - # "sufdirabrv", sa.VARCHAR(length=15), autoincrement=False, nullable=True - # ), - # sa.Column( - # "suftypabrv", sa.VARCHAR(length=50), autoincrement=False, nullable=True - # ), - # sa.Column( - # "sufqualabr", sa.VARCHAR(length=15), autoincrement=False, nullable=True - # ), - # sa.Column("predir", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("pretyp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("prequal", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("sufdir", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("suftyp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("sufqual", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column( - # "linearid", sa.VARCHAR(length=22), autoincrement=False, nullable=True - # ), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("paflag", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("gid", name="featnames_pkey"), - # ) - # op.create_index( - # "idx_tiger_featnames_tlid_statefp", - # "featnames", - # ["tlid", "statefp"], - # unique=False, - # ) - # op.create_index( - # "idx_tiger_featnames_snd_name", - # "featnames", - # [sa.text("soundex(name::text)")], - # unique=False, - # ) - # op.create_index( - # "idx_tiger_featnames_lname", - # "featnames", - # [sa.text("lower(name::text)")], - # unique=False, - # ) - # op.create_table( - # "county_lookup", - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("state", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("co_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("st_code", "co_code", name="county_lookup_pkey"), - # ) - # op.create_index("county_lookup_state_idx", "county_lookup", ["state"], unique=False) - # op.create_index( - # "county_lookup_name_idx", - # "county_lookup", - # [sa.text("soundex(name::text)")], - # unique=False, - # ) - # op.create_table( - # "tract", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column( - # "tract_id", sa.VARCHAR(length=11), autoincrement=False, nullable=False - # ), - # sa.Column("name", sa.VARCHAR(length=7), autoincrement=False, nullable=True), - # sa.Column( - # "namelsad", sa.VARCHAR(length=20), autoincrement=False, nullable=True - # ), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_geom"), - # sa.PrimaryKeyConstraint("tract_id", name="tract_pkey"), - # ) - # op.create_table( - # "topology", - # sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("name", sa.VARCHAR(), autoincrement=False, nullable=False), - # sa.Column("srid", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column( - # "precision", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=False, - # ), - # sa.Column( - # "hasz", - # sa.BOOLEAN(), - # server_default=sa.text("false"), - # autoincrement=False, - # nullable=False, - # ), - # sa.PrimaryKeyConstraint("id", name="topology_pkey"), - # sa.UniqueConstraint("name", name="topology_name_key"), - # ) - # op.create_table( - # "geocode_settings_default", - # sa.Column("name", sa.TEXT(), autoincrement=False, nullable=False), - # sa.Column("setting", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("unit", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("category", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("short_desc", sa.TEXT(), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("name", name="geocode_settings_default_pkey"), - # ) - # op.create_table( - # "state_lookup", - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=40), autoincrement=False, nullable=True), - # sa.Column("abbrev", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.CHAR(length=2), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("st_code", name="state_lookup_pkey"), - # sa.UniqueConstraint("abbrev", name="state_lookup_abbrev_key"), - # sa.UniqueConstraint("name", name="state_lookup_name_key"), - # sa.UniqueConstraint("statefp", name="state_lookup_statefp_key"), - # ) - # op.create_table( - # "tabblock", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("blockce", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column( - # "tabblock_id", sa.VARCHAR(length=16), autoincrement=False, nullable=False - # ), - # sa.Column("name", sa.VARCHAR(length=20), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("ur", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("uace", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_geom"), - # sa.PrimaryKeyConstraint("tabblock_id", name="tabblock_pkey"), - # ) - # op.create_table( - # "faces", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column( - # "tfid", - # sa.NUMERIC(precision=10, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "statefp00", sa.VARCHAR(length=2), autoincrement=False, nullable=True - # ), - # sa.Column( - # "countyfp00", sa.VARCHAR(length=3), autoincrement=False, nullable=True - # ), - # sa.Column( - # "tractce00", sa.VARCHAR(length=6), autoincrement=False, nullable=True - # ), - # sa.Column( - # "blkgrpce00", sa.VARCHAR(length=1), autoincrement=False, nullable=True - # ), - # sa.Column( - # "blockce00", sa.VARCHAR(length=4), autoincrement=False, nullable=True - # ), - # sa.Column( - # "cousubfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "submcdfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "conctyfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "placefp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "aiannhfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "aiannhce00", sa.VARCHAR(length=4), autoincrement=False, nullable=True - # ), - # sa.Column( - # "comptyp00", sa.VARCHAR(length=1), autoincrement=False, nullable=True - # ), - # sa.Column( - # "trsubfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "trsubce00", sa.VARCHAR(length=3), autoincrement=False, nullable=True - # ), - # sa.Column("anrcfp00", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column( - # "elsdlea00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "scsdlea00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column( - # "unsdlea00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column("uace00", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("cd108fp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("sldust00", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("sldlst00", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("vtdst00", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column( - # "zcta5ce00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column("tazce00", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("ugace00", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column( - # "puma5ce00", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("blkgrpce", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("blockce", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("cousubfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("submcdfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("conctyfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("placefp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("aiannhfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("aiannhce", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("comptyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("trsubfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("trsubce", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("anrcfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("ttractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("tblkgpce", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("elsdlea", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("scsdlea", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("unsdlea", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("uace", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("cd111fp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("sldust", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("sldlst", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("vtdst", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("zcta5ce", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("tazce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("ugace", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("puma5ce", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("csafp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("cbsafp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("metdivfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("cnectafp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("nectafp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("nctadvfp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("lwflag", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("offset", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "atotal", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "tractce20", sa.VARCHAR(length=6), autoincrement=False, nullable=True - # ), - # sa.Column( - # "blkgrpce20", sa.VARCHAR(length=1), autoincrement=False, nullable=True - # ), - # sa.Column( - # "blockce20", sa.VARCHAR(length=4), autoincrement=False, nullable=True - # ), - # sa.Column( - # "countyfp20", sa.VARCHAR(length=3), autoincrement=False, nullable=True - # ), - # sa.Column( - # "statefp20", sa.VARCHAR(length=2), autoincrement=False, nullable=True - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("gid", name="faces_pkey"), - # ) - # op.create_index( - # "tiger_faces_the_geom_gist", - # "faces", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_index("idx_tiger_faces_tfid", "faces", ["tfid"], unique=False) - # op.create_index("idx_tiger_faces_countyfp", "faces", ["countyfp"], unique=False) - # op.create_table( - # "zcta5", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("zcta5ce", sa.VARCHAR(length=5), autoincrement=False, nullable=False), - # sa.Column("classfp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column("partflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("zcta5ce", "statefp", name="pk_tiger_zcta5_zcta5ce"), - # sa.UniqueConstraint("gid", name="uidx_tiger_zcta5_gid"), - # ) - # op.create_table( - # "pagc_lex", - # sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("seq", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column("word", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("stdword", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("token", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column( - # "is_custom", - # sa.BOOLEAN(), - # server_default=sa.text("true"), - # autoincrement=False, - # nullable=False, - # ), - # sa.PrimaryKeyConstraint("id", name="pagc_lex_pkey"), - # ) - # op.create_table( - # "secondary_unit_lookup", - # sa.Column("name", sa.VARCHAR(length=20), autoincrement=False, nullable=False), - # sa.Column("abbrev", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("name", name="secondary_unit_lookup_pkey"), - # ) - # op.create_index( - # "secondary_unit_lookup_abbrev_idx", - # "secondary_unit_lookup", - # ["abbrev"], - # unique=False, - # ) - # op.create_table( - # "bg", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tractce", sa.VARCHAR(length=6), autoincrement=False, nullable=True), - # sa.Column("blkgrpce", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("bg_id", sa.VARCHAR(length=12), autoincrement=False, nullable=False), - # sa.Column( - # "namelsad", sa.VARCHAR(length=13), autoincrement=False, nullable=True - # ), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "aland", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "awater", - # sa.DOUBLE_PRECISION(precision=53), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # spatial_index=False, - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_geom"), - # sa.PrimaryKeyConstraint("bg_id", name="bg_pkey"), - # comment="block groups", - # ) - # op.create_table( - # "spatial_ref_sys", - # sa.Column("srid", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column( - # "auth_name", sa.VARCHAR(length=256), autoincrement=False, nullable=True - # ), - # sa.Column("auth_srid", sa.INTEGER(), autoincrement=False, nullable=True), - # sa.Column( - # "srtext", sa.VARCHAR(length=2048), autoincrement=False, nullable=True - # ), - # sa.Column( - # "proj4text", sa.VARCHAR(length=2048), autoincrement=False, nullable=True - # ), - # sa.CheckConstraint( - # "srid > 0 AND srid <= 998999", name="spatial_ref_sys_srid_check" - # ), - # sa.PrimaryKeyConstraint("srid", name="spatial_ref_sys_pkey"), - # ) - # op.create_table( - # "place", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("placefp", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("placens", sa.VARCHAR(length=8), autoincrement=False, nullable=True), - # sa.Column("plcidfp", sa.VARCHAR(length=7), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), - # sa.Column( - # "namelsad", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("lsad", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("classfp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("cpi", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("pcicbsa", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("pcinecta", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("aland", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column("awater", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("plcidfp", name="place_pkey"), - # sa.UniqueConstraint("gid", name="uidx_tiger_place_gid"), - # ) - # op.create_index( - # "tiger_place_the_geom_gist", - # "place", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_table( - # "direction_lookup", - # sa.Column("name", sa.VARCHAR(length=20), autoincrement=False, nullable=False), - # sa.Column("abbrev", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("name", name="direction_lookup_pkey"), - # ) - # op.create_index( - # "direction_lookup_abbrev_idx", "direction_lookup", ["abbrev"], unique=False - # ) - # op.create_table( - # "edges", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("countyfp", sa.VARCHAR(length=3), autoincrement=False, nullable=True), - # sa.Column("tlid", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column( - # "tfidl", - # sa.NUMERIC(precision=10, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "tfidr", - # sa.NUMERIC(precision=10, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column( - # "fullname", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("smid", sa.VARCHAR(length=22), autoincrement=False, nullable=True), - # sa.Column( - # "lfromadd", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column("ltoadd", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column( - # "rfromadd", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column("rtoadd", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("zipl", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("zipr", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("featcat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("hydroflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("railflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("roadflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("olfflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("passflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("divroad", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("exttyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("ttyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "deckedroad", sa.VARCHAR(length=1), autoincrement=False, nullable=True - # ), - # sa.Column("artpath", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("persist", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("gcseflg", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("offsetl", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("offsetr", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "tnidf", - # sa.NUMERIC(precision=10, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "tnidt", - # sa.NUMERIC(precision=10, scale=0), - # autoincrement=False, - # nullable=True, - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTILINESTRING'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("gid", name="edges_pkey"), - # ) - # op.create_index( - # "idx_tiger_edges_the_geom_gist", - # "edges", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_index("idx_tiger_edges_countyfp", "edges", ["countyfp"], unique=False) - # op.create_index("idx_edges_tlid", "edges", ["tlid"], unique=False) - # op.create_table( - # "state", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("region", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("division", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("statens", sa.VARCHAR(length=8), autoincrement=False, nullable=True), - # sa.Column("stusps", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), - # sa.Column("lsad", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("funcstat", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("aland", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column("awater", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column( - # "intptlat", sa.VARCHAR(length=11), autoincrement=False, nullable=True - # ), - # sa.Column( - # "intptlon", sa.VARCHAR(length=12), autoincrement=False, nullable=True - # ), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("statefp", name="pk_tiger_state"), - # sa.UniqueConstraint("gid", name="uidx_tiger_state_gid"), - # sa.UniqueConstraint("stusps", name="uidx_tiger_state_stusps"), - # ) - # op.create_index( - # "idx_tiger_state_the_geom_gist", - # "state", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_table( - # "zip_lookup_base", - # sa.Column("zip", sa.VARCHAR(length=5), autoincrement=False, nullable=False), - # sa.Column("state", sa.VARCHAR(length=40), autoincrement=False, nullable=True), - # sa.Column("county", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("city", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("zip", name="zip_lookup_base_pkey"), - # ) - # op.create_table( - # "addrfeat", - # sa.Column("gid", sa.INTEGER(), autoincrement=True, nullable=False), - # sa.Column("tlid", sa.BIGINT(), autoincrement=False, nullable=True), - # sa.Column("statefp", sa.VARCHAR(length=2), autoincrement=False, nullable=False), - # sa.Column("aridl", sa.VARCHAR(length=22), autoincrement=False, nullable=True), - # sa.Column("aridr", sa.VARCHAR(length=22), autoincrement=False, nullable=True), - # sa.Column( - # "linearid", sa.VARCHAR(length=22), autoincrement=False, nullable=True - # ), - # sa.Column( - # "fullname", sa.VARCHAR(length=100), autoincrement=False, nullable=True - # ), - # sa.Column("lfromhn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("ltohn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("rfromhn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("rtohn", sa.VARCHAR(length=12), autoincrement=False, nullable=True), - # sa.Column("zipl", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column("zipr", sa.VARCHAR(length=5), autoincrement=False, nullable=True), - # sa.Column( - # "edge_mtfcc", sa.VARCHAR(length=5), autoincrement=False, nullable=True - # ), - # sa.Column("parityl", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("parityr", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("plus4l", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("plus4r", sa.VARCHAR(length=4), autoincrement=False, nullable=True), - # sa.Column("lfromtyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("ltotyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("rfromtyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("rtotyp", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("offsetl", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column("offsetr", sa.VARCHAR(length=1), autoincrement=False, nullable=True), - # sa.Column( - # "the_geom", - # geoalchemy2.types.Geometry( - # from_text="ST_GeomFromEWKT", - # name="geometry", - # _spatial_index_reflected=True, - # ), - # autoincrement=False, - # nullable=True, - # ), - # sa.CheckConstraint( - # "geometrytype(the_geom) = 'LINESTRING'::text OR the_geom IS NULL", - # name="enforce_geotype_the_geom", - # ), - # sa.CheckConstraint("st_ndims(the_geom) = 2", name="enforce_dims_the_geom"), - # sa.CheckConstraint("st_srid(the_geom) = 4269", name="enforce_srid_the_geom"), - # sa.PrimaryKeyConstraint("gid", name="addrfeat_pkey"), - # ) - # op.create_index("idx_addrfeat_zipr", "addrfeat", ["zipr"], unique=False) - # op.create_index("idx_addrfeat_zipl", "addrfeat", ["zipl"], unique=False) - # op.create_index("idx_addrfeat_tlid", "addrfeat", ["tlid"], unique=False) - # op.create_index( - # "idx_addrfeat_geom_gist", - # "addrfeat", - # ["the_geom"], - # unique=False, - # postgresql_using="gist", - # ) - # op.create_table( - # "place_lookup", - # sa.Column("st_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("state", sa.VARCHAR(length=2), autoincrement=False, nullable=True), - # sa.Column("pl_code", sa.INTEGER(), autoincrement=False, nullable=False), - # sa.Column("name", sa.VARCHAR(length=90), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("st_code", "pl_code", name="place_lookup_pkey"), - # ) - # op.create_index("place_lookup_state_idx", "place_lookup", ["state"], unique=False) - # op.create_index( - # "place_lookup_name_idx", - # "place_lookup", - # [sa.text("soundex(name::text)")], - # unique=False, - # ) - # op.create_table( - # "geocode_settings", - # sa.Column("name", sa.TEXT(), autoincrement=False, nullable=False), - # sa.Column("setting", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("unit", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("category", sa.TEXT(), autoincrement=False, nullable=True), - # sa.Column("short_desc", sa.TEXT(), autoincrement=False, nullable=True), - # sa.PrimaryKeyConstraint("name", name="geocode_settings_pkey"), - # ) - # op.drop_index(op.f("ix_gps_trajectory_id"), table_name="trajectory", schema="gps") - # op.drop_index( - # "idx_trajectory_geom", - # table_name="trajectory", - # schema="gps", - # postgresql_using="gist", - # ) - # op.drop_table("trajectory", schema="gps") - # op.drop_index(op.f("ix_gps_feed_item_id"), table_name="feed_item", schema="gps") - # op.drop_table("feed_item", schema="gps") - # # ### end Alembic commands ### diff --git a/migrations/versions/__init__.py b/migrations/versions/__init__.py deleted file mode 100644 index e69de29..0000000