feat(geofence): watch list, filtered hit log, fence snapshot
Off-viewport clients that send {type:watch_geofences,ids} on /ws/live
still receive geofence_alert; AIS/ADS-B stay viewport-only.
GET /api/geofence-alerts accepts geofence_id/since/until/source_kind.
GET /api/geofences/{id}/at returns CAGG+FIRMS inside the fence at T
(404 if missing, empty lists if DB down). DELETE missing fences 404s.
This commit is contained in:
parent
6ff2fd0351
commit
f6c1cfc454
6 changed files with 625 additions and 37 deletions
24
alembic/versions/011_geofence_alerts_fence.py
Normal file
24
alembic/versions/011_geofence_alerts_fence.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"""geofence_alerts (geofence_id, created_at DESC) for fence-scoped hit log
|
||||
|
||||
Revision ID: 011_geofence_alerts_fence
|
||||
Revises: 010_bbox_gist
|
||||
Create Date: 2026-09-01
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "011_geofence_alerts_fence"
|
||||
down_revision = "010_bbox_gist"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.execute(
|
||||
"CREATE INDEX IF NOT EXISTS ix_geofence_alerts_fence_created "
|
||||
"ON geofence_alerts (geofence_id, created_at DESC)"
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.execute("DROP INDEX IF EXISTS ix_geofence_alerts_fence_created")
|
||||
Loading…
Reference in a new issue