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

V120: Document Creator Category → Type taxonomy.

Creates two tables — `phoenix_kit_doc_categories` and
`phoenix_kit_doc_types` — and adds nullable `category_uuid` /
`type_uuid` FK columns to `phoenix_kit_doc_templates` and
`phoenix_kit_doc_documents`.

Data migration: each distinct non-empty legacy `category` string on
templates becomes a Category row (matched case-insensitively, so
`"Financial"` and `"financial"` collapse into one); templates are
repointed via `category_uuid`; documents inherit their template's
category. The legacy `category` string columns on templates and
presets are then dropped. `type_uuid` stays NULL everywhere (no
Types yet).

Note: `phoenix_kit_doc_template_presets` does not get a
`category_uuid` column — presets do not join the new taxonomy, and
their legacy `category` strings are discarded (not migrated).
Dropping the preset `category` column also drops the V117
`phoenix_kit_doc_template_presets_scope_index`, which this migration
recreates on `(scope_type, scope_id)`.

All operations are idempotent.

# `down`

# `up`

---

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