app.push_subscriptions
TableRow level security on
Devices registered for push, per membership, so leaving an org stops its pushes (invariant 3): Compass devices through Expo Notifications (an Expo push token), and browsers through Web Push with VAPID (an endpoint and its keys, 1533).
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.memberships on insert; never accepted from the caller and never changed.References app.organizations.id |
| membership_id | uuid | No | Membership the device receives pushes for.References app.memberships.id |
| expo_push_token | text | Yes | Expo push token of a Compass device; null for a browser. |
| platform | text | No | ios, android or web; web exactly when the row is a browser. |
| last_seen_at | timestamp with time zone | No | Last time the device re-registered. |
| revoked_at | timestamp with time zone | Yes | When the device was revoked: by the person, by a push service that no longer knows it (Expo DeviceNotRegistered, Web Push 404 or 410), or because another person registered the same browser. |
| 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. |
| web_endpoint | text | Yes | Web Push endpoint of a browser (RFC 8030), an https URL of its push service; null for a Compass device. |
| web_p256dh | text | Yes | The browser's P-256 public key for message encryption (RFC 8291), base64url; null for a Compass device. |
| web_auth | text | Yes | The browser's 16-byte authentication secret (RFC 8291), base64url; null for a Compass device. |
| web_app | text | Yes | App the browser subscribed in, Atlas or Gateway, whose service worker shows the push and opens its link; null for a Compass device. |