PhoenixKit.Migrations.Postgres.V154 (phoenix_kit v1.7.208)

Copy Markdown View Source

V154: OpenGraph templates + hierarchical assignments (phoenix_kit_og plugin).

phoenix_kit_og_templates

Reusable OG canvas designs. canvas is JSONB so the structure can grow new element types without a schema change. preview_image_uuid is an optional pointer to a rendered cached preview.

phoenix_kit_og_assignments

Binds a template to a scope inside a consumer module's hierarchy. The (module_key, scope_type, scope_uuid) triple is unique — enforced via a partial-index pair because PostgreSQL treats NULL as distinct:

  • one row per (module, scope_type) when scope_uuid IS NULL (the module-wide default tier)
  • one row per (module, scope_type, scope_uuid) when not null

template_uuid cascades on delete: removing a template wipes every assignment that pointed at it.

All operations are idempotent.

Summary

Functions

Rolls V154 back by dropping the two OG tables.

Functions

down(opts)

Rolls V154 back by dropping the two OG tables.

Lossy rollback: all templates and assignments are lost. Back up before rolling back in production.

up(opts)