- Denormalize organization_id from device to alerts table - Add composite indexes on (organization_id, alert_type, resolved_at) - Optimize list_organization_active_alerts to use single-table query - Eliminates expensive 3-table joins (alerts → device → site) - Auto-populate organization_id when creating alerts - Backfill existing alerts in migration Fixes bug #14 from reliability audit. |
||
|---|---|---|
| .. | ||
| alert.ex | ||