-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
407 additions
and
192 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""add-country | ||
Revision ID: 5b41d404cb3b | ||
Revises: 675f3d3e99af | ||
Create Date: 2024-02-23 19:31:48.163498 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from geoalchemy2 import Geometry | ||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '5b41d404cb3b' | ||
down_revision = '675f3d3e99af' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('country', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('name_en', sa.String(length=500), nullable=True), | ||
sa.Column('name_zh', sa.String(length=500), nullable=True), | ||
sa.Column('continent', sa.String(length=500), nullable=True), | ||
sa.Column('iso3166_1', sa.String(length=2), nullable=True), | ||
sa.Column('iso3', sa.String(length=3), nullable=True), | ||
sa.Column('status', sa.String(length=500), nullable=True), | ||
sa.Column('sort', sa.Integer(), nullable=True), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('country') | ||
# ### 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""add-geom | ||
Revision ID: 675f3d3e99af | ||
Revises: fb2dd663057f | ||
Create Date: 2024-02-23 18:36:09.844916 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from geoalchemy2 import Geometry | ||
import geoalchemy2 | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '675f3d3e99af' | ||
down_revision = 'fb2dd663057f' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_geospatial_column('named_area', sa.Column('geom_mpoly', Geometry(geometry_type='MULTIPOLYGON', srid=4326, spatial_index=False, from_text='ST_GeomFromEWKT', name='geometry'), nullable=True)) | ||
op.create_geospatial_index('idx_named_area_geom_mpoly', 'named_area', ['geom_mpoly'], unique=False, postgresql_using='gist', postgresql_ops={}) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_geospatial_index('idx_named_area_geom_mpoly', table_name='named_area', postgresql_using='gist', column_name='geom_mpoly') | ||
op.drop_geospatial_column('named_area', 'geom_mpoly') | ||
# ### 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
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.