g1t/services/identity/migrations/0021_waitlist_notices.sql
| 1 | -- Telling people about the waitlist: the person who asked gets one |
| 2 | -- confirmation, staff get a summary of new requests at most every 15 |
| 3 | -- minutes, and an approval can carry a note into the invite email. Every |
| 4 | -- timestamp is RFC 3339 UTC. See src/invites.rs. |
| 5 | |
| 6 | -- When the confirmation went to the address. Null: not sent (requests from |
| 7 | -- before this migration, or sending failed). |
| 8 | ALTER TABLE waitlist ADD COLUMN acknowledged_at TEXT; |
| 9 | -- When staff were told about the request. Null: not yet; the next summary |
| 10 | -- includes it. |
| 11 | ALTER TABLE waitlist ADD COLUMN notified_at TEXT; |
| 12 | -- What staff wrote when approving, sent in the invite email. |
| 13 | ALTER TABLE waitlist ADD COLUMN note TEXT; |
| 14 | |
| 15 | -- Requests from before this: staff already see them in sudo, so no summary |
| 16 | -- repeats them. |
| 17 | UPDATE waitlist SET notified_at = updated_at WHERE notified_at IS NULL; |
| 18 | |
| 19 | CREATE INDEX IF NOT EXISTS waitlist_status_created ON waitlist (status, created_at); |
| 20 | CREATE INDEX IF NOT EXISTS waitlist_unnotified ON waitlist (notified_at) WHERE notified_at IS NULL; |