-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task/WG-396: sqlachemy-update follow on (#231)
* Add migration to update to newer PostGis * Revert "Add migration to update to newer PostGis" This reverts commit 74977c7. * Include models so that autogenerate works in sqlachemy2 * Omit PostGIS-related migrations as those handled by postgis PostGIS manages its own schema * Add migraiton of spatial index of feature's the_geom The default behavior for spatial indexing in GeoAlchemy2. This migration should have been added earlier in projects development * Update README now that we try to omit all PostGIS-related migrations See commit 3a641cb * Fix linting/formatting issues
- Loading branch information
1 parent
7e80795
commit 4f0b165
Showing
4 changed files
with
150 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
geoapi/migrations/versions/20241211_0351-f2d7f797c82a_add_migration_of_spatial_index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Add migration of spatial index | ||
Revision ID: f2d7f797c82a | ||
Revises: 968f358e102a | ||
Create Date: 2024-12-11 03:51:58.509951 | ||
""" | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "f2d7f797c82a" | ||
down_revision = "968f358e102a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_index( | ||
"idx_features_the_geom", | ||
"features", | ||
["the_geom"], | ||
unique=False, | ||
postgresql_using="gist", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index( | ||
"idx_features_the_geom", table_name="features", postgresql_using="gist" | ||
) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters