V96: Attach catalogue items directly to a catalogue.
Adds a nullable catalogue_uuid FK on phoenix_kit_cat_items so items
can belong to a catalogue independently of having a category. This lets
"uncategorized" items (items with no category) still be scoped to a
catalogue instead of floating in a global pool.
- Adds
catalogue_uuidcolumn with a FK tophoenix_kit_cat_catalogues(on_delete: :nilify_all) — in-app cascades handle soft-delete lifecycle - Backfills existing items from their category's catalogue_uuid
- Pins any remaining orphans (items with no category at all) to the oldest non-deleted catalogue so they stay visible in the UI
- Adds indexes on
catalogue_uuidand(catalogue_uuid, status)
All operations are idempotent.
Summary
Functions
Rolls V96 back by dropping the catalogue_uuid column (and its indexes).
Functions
Rolls V96 back by dropping the catalogue_uuid column (and its indexes).
Lossy rollback: items that were created after V96 as uncategorized
(no category) have their catalogue linkage stored solely in
catalogue_uuid. Dropping the column means those items can no longer
be attributed to a catalogue — they'll become global orphans again
(their pre-V96 shape). Back up before rolling back in production.