23 lines
536 B
Python
23 lines
536 B
Python
"""Index partitioned vector features by dataset and municipality."""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "202607160001"
|
|
down_revision = "202607150001"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_index(
|
|
"ix_vector_features_dataset_municipality",
|
|
"vector_features",
|
|
["dataset_id", sa.text("(properties_json ->> 'municipality')")],
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_vector_features_dataset_municipality", table_name="vector_features")
|