PhoenixKit.Migrations.Postgres.V146 (phoenix_kit v1.7.207)

Copy Markdown View Source

V146: primary_supplier_uuid on catalogue items.

Backs phoenix_kit_catalogue's per-item default supplier (upstream catalogue commit 2e47cdf): lets an item specify a supplier directly, independent of manufacturer — needed for generic/unbranded materials that have no brand to resolve a supplier through, and to break ties when a manufacturer has more than one linked supplier.

  • Nullable primary_supplier_uuid FK → phoenix_kit_cat_suppliers(uuid) with ON DELETE SET NULL — the pointer is an optional default; the item must survive its supplier (mirrors category_uuid's nilify semantics, deliberately NOT manufacturer_uuid's delete_all).
  • Partial index on (primary_supplier_uuid) WHERE NOT NULL for the "items defaulting to this supplier" reverse lookup.

Idempotent + prefix-safe: bare index name on CREATE, all existence checks schema-anchored, FK constraint checked via pg_constraint anchored to the prefixed table (the V51 idiom).

Summary

Functions

down(opts)

up(opts)