app.notification_deliveries
TablePartitioned by monthRow level security on
One notification on one outside channel (Email, SMS, Push), partitioned on the notification's month so both expire together. Written by private.notify and the delivery worker.
Primary key: id, notification_created_at
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Delivery id, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.notifications on insert; never accepted from the caller and never changed.References app.organizations.id |
| notification_id | uuid | No | Notification delivered.References private.notifications_p202609.id |
| notification_created_at | timestamp with time zone | No | Creation time of the notification: its partition key, checked by the foreign key.References private.notifications_p202609.created_at |
| channel | app.notification_channel | No | Email, SMS or Push. |
| message_status | app.message_status | No | Queued, Deferred, Digest, Sent, Delivered, Bounced, Failed or Suppressed. |
| deliver_after | timestamp with time zone | No | Earliest send time: now, or the end of the recipient's quiet hours. |
| attempt_count | smallint | No | Send attempts so far. |
| provider_message_id | text | Yes | Message id returned by Resend, Twilio or Expo. |
| last_error | text | Yes | Error of the latest failed attempt, or why the delivery was suppressed. |
| sent_at | timestamp with time zone | Yes | When the provider accepted the message. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |