PhoenixKit.Migrations.Postgres.V97 (phoenix_kit v1.7.102)

Copy Markdown View Source

V97: Per-item markup override.

Adds a nullable markup_percentage DECIMAL(7, 2) column on phoenix_kit_cat_items. When NULL, pricing falls back to the parent catalogue's markup_percentage; when set (including 0), the item uses its own value.

This lets individual items carry a different margin from the rest of the catalogue without needing a second catalogue or a separate pricing table. NULL vs. 0 is load-bearing: 0 means "explicitly sell at base price", NULL means "inherit whatever the catalogue currently uses".

The column is nullable with no default, matching the semantic distinction. Existing rows stay NULL and continue to inherit — no backfill is needed.

Summary

Functions

Rolls V97 back by dropping the per-item markup_percentage column.

Functions

down(opts)

Rolls V97 back by dropping the per-item markup_percentage column.

Lossy rollback: any per-item overrides set after V97 are lost — affected items revert to the catalogue's markup. Back up before rolling back in production.

up(opts)