PhoenixKit.Migrations.Postgres.V126 (phoenix_kit v1.7.130)

Copy Markdown View Source

V126: Allow standalone notifications.

Until now every phoenix_kit_notifications row had to point at an activity_uuid (NOT NULL) — a notification was strictly a per-user projection of an activity. This relaxes that so a notification can exist on its own:

  1. Drops NOT NULL on activity_uuid. The unique (activity_uuid, recipient_uuid) index keeps working — Postgres treats NULLs as distinct by default, so a recipient can hold many standalone notifications.
  2. Adds metadata JSONB NOT NULL DEFAULT '{}' so a standalone notification carries its own display content. Render reads the same notification_text / notification_icon / notification_link keys it already honors on activity metadata.

Idempotent: DROP NOT NULL is a no-op when already nullable and the column add is IF NOT EXISTS.

Summary

Functions

down(opts)

up(opts)