# `PhoenixKit.Migrations.Postgres.V126`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.165/lib/phoenix_kit/migrations/postgres/v126.ex#L1)

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`.

# `down`

# `up`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
