diff --git a/infra/firestore/firestore.indexes.json b/infra/firestore/firestore.indexes.json index 3308fb7..f9e4698 100644 --- a/infra/firestore/firestore.indexes.json +++ b/infra/firestore/firestore.indexes.json @@ -75,6 +75,16 @@ { "fieldPath": "acknowledged", "order": "ASCENDING" }, { "fieldPath": "triggered_at", "order": "ASCENDING" } ] + }, + { + "//": "drb-frontend lib/useAlerts.ts useUnacknowledgedAlerts (nav badge) and the /watch \"Triggered Alerts\" tab — where(org_id ==) where(acknowledged == false) orderBy(triggered_at desc). Threw \"the query requires an index\" on every page until this was declared (server-26#51). Field tuple and triggered_at DESCENDING copy the console create_composite link in that issue verbatim, so a gcloud/console create and a firebase deploy converge on one index rather than the ASC-vs-DESC pair that caused server-26#33. Distinct from the (org_id, triggered_at) alert-feed index above (no acknowledged filter) and supersedes the pre-tenancy live alert_events(acknowledged, triggered_at) index #33 says to delete.", + "collectionGroup": "alert_events", + "queryScope": "COLLECTION", + "fields": [ + { "fieldPath": "acknowledged", "order": "ASCENDING" }, + { "fieldPath": "org_id", "order": "ASCENDING" }, + { "fieldPath": "triggered_at", "order": "DESCENDING" } + ] } ], "fieldOverrides": []