Add services layer, tests, streaming UI, and cleanup legacy code
This commit is contained in:
parent
5514fa6381
commit
d205d15c74
62 changed files with 3729 additions and 1024 deletions
|
|
@ -0,0 +1,56 @@
|
|||
"""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')
|
||||
Loading…
Add table
Add a link
Reference in a new issue