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

V63: UUID Companion Column Safety Net — Round 2

Adds missing `uuid` and `_uuid` FK companion columns identified after V62.
All operations are idempotent — safe to run on any installation.

## Issues Fixed

### 1. `phoenix_kit_ai_accounts` missing `uuid` column

V61 used the wrong table name in `@tables_missing_uuid` (listed
`phoenix_kit_ai_requests` instead of `phoenix_kit_ai_accounts`). This
left `ai_accounts` as the only legacy table without a `uuid` identity
column.

### 2. `phoenix_kit_ai_requests` missing `account_uuid` companion

The `account_id` integer FK had no UUID companion. Backfilled via JOIN
to `phoenix_kit_ai_accounts` once that table has its `uuid` column.

### 3. `phoenix_kit_email_orphaned_events` missing `matched_email_log_uuid`

The `matched_email_log_id` integer FK had no UUID companion. Backfilled
via JOIN to `phoenix_kit_email_logs`.

### 4. `phoenix_kit_invoices` missing `subscription_uuid` companion

The `subscription_id` integer FK had no UUID companion. Backfilled via
JOIN to `phoenix_kit_subscriptions`.

### 5. `phoenix_kit_shop_cart_items` missing `variant_uuid` companion

The `variant_id` integer FK had no UUID companion. No backfill possible
(no variants table in schema); column added as nullable for future use.

# `down`

# `up`

---

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