The crawler subdirectory was the only active project. Moving it to the repo root simplifies paths and removes the unnecessary nesting. The vqa/ and immoweb/ directories were legacy/unused and have been removed. Updated .drone.yml, .gitignore, .claude/ docs, and skills to reflect the new flat structure.
56 lines
1.6 KiB
Python
56 lines
1.6 KiB
Python
"""add streaming indexes for query optimization
|
|
|
|
Revision ID: a1b2c3d4e5f6
|
|
Revises: e5f1bc4e3323
|
|
Create Date: 2026-02-01 12:00:00.000000
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'a1b2c3d4e5f6'
|
|
down_revision: Union[str, None] = 'e5f1bc4e3323'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Add composite and single-column indexes for streaming query optimization."""
|
|
# Composite index for main query pattern (bedrooms, price, last_seen filtering)
|
|
op.create_index(
|
|
'ix_rentlisting_query_composite',
|
|
'rentlisting',
|
|
['number_of_bedrooms', 'price', 'last_seen'],
|
|
unique=False
|
|
)
|
|
op.create_index(
|
|
'ix_buylisting_query_composite',
|
|
'buylisting',
|
|
['number_of_bedrooms', 'price', 'last_seen'],
|
|
unique=False
|
|
)
|
|
|
|
# Missing single-column indexes for frequently filtered columns
|
|
op.create_index(
|
|
'ix_rentlisting_furnish_type',
|
|
'rentlisting',
|
|
['furnish_type'],
|
|
unique=False
|
|
)
|
|
op.create_index(
|
|
'ix_rentlisting_available_from',
|
|
'rentlisting',
|
|
['available_from'],
|
|
unique=False
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Remove streaming indexes."""
|
|
op.drop_index('ix_rentlisting_available_from', table_name='rentlisting')
|
|
op.drop_index('ix_rentlisting_furnish_type', table_name='rentlisting')
|
|
op.drop_index('ix_buylisting_query_composite', table_name='buylisting')
|
|
op.drop_index('ix_rentlisting_query_composite', table_name='rentlisting')
|