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

V72: Rename `id` → `uuid` on Category A tables + add missing FK constraints.

Category A tables have a UUID primary key column named `id`. Ecto schemas map
field `:uuid` → DB column `id` via `source: :id`. This migration renames the
DB column to `uuid` so the `source: :id` mapping is no longer needed.

## Changes

- Rename `id` → `uuid` on 30 Category A tables (metadata-only, instant)
- Add 4 missing FK constraints:
  - `phoenix_kit_comments.user_uuid` → `phoenix_kit_users.uuid` (CASCADE)
  - `phoenix_kit_comments_dislikes.user_uuid` → `phoenix_kit_users.uuid` (CASCADE)
  - `phoenix_kit_comments_likes.user_uuid` → `phoenix_kit_users.uuid` (CASCADE)
  - `phoenix_kit_scheduled_jobs.created_by_uuid` → `phoenix_kit_users.uuid` (SET NULL)

All operations are idempotent (guarded by column/constraint existence checks).

## Safety

- Column renames are metadata-only in PostgreSQL — zero downtime, instant
- 29 existing FK constraints referencing these columns auto-update on rename
- Deploy is atomic: migration runs on startup before new code serves traffic

# `down`

# `up`

---

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