V104: Per-user notifications driven by the activity feed.
Creates phoenix_kit_notifications — one row per (activity, recipient_user)
with independent seen_at / dismissed_at timestamps. Generated in fan-out
fashion by PhoenixKit.Notifications.maybe_create_from_activity/1 whenever an
activity targets a user other than the actor.
Schema
uuid— UUIDv7 primary keyactivity_uuid— FK →phoenix_kit_activities(ON DELETE CASCADE)recipient_uuid— FK →phoenix_kit_users(ON DELETE CASCADE)seen_at—NULL= unread; set when the user clicks the row oruses "Mark all as seen"dismissed_at—NULL= still visible; set when the user dismissesinserted_at— creation timestamp (noupdated_at)
Indexes
- Unique (
activity_uuid,recipient_uuid) — one notification per activity per recipient - Partial (
recipient_uuid,inserted_at) WHEREdismissed_at IS NULL— covers the main "my undismissed inbox, newest first" read path
All operations are idempotent.