| 1 | -- Which subscriber queues an event already reached, written only when |
| 2 | -- passing a batch on failed part way: its retry skips the queues that |
| 3 | -- have it. Rows older than a day are removed by the daily sweep. |
| 4 | CREATE TABLE fanout_sent ( |
| 5 | event_id TEXT PRIMARY KEY, |
| 6 | -- JSON array of SUBSCRIBER_* binding names. |
| 7 | bindings TEXT NOT NULL, |
| 8 | created_at TEXT NOT NULL |
| 9 | ); |
| 10 | CREATE INDEX fanout_sent_by_age ON fanout_sent (created_at); |