pf_app/setup_sql
Paul Trowbridge 81c2324220 Expose load segments and adjustment notes as separate pivot columns
The label on a baseline or reference load ("Open Orders", "Prior Year")
lived only on the pf.log row; the data stream was a straight dump of the
forecast table, so Perspective saw pf_logid and never the name.

The stream now joins pf.log and emits two columns rather than one, because
commingling them makes neither useful: pf_segment names the load a row came
from, and is '(adjustment)' for everything else; pf_note carries the free
text on scale/recode/clone and is null on loads. The operation routes stamp
the same two fields on the rows they push back incrementally.

The tag column those labels belong in is declared in 01_schema.sql but
predates some installs, so the backfill seeding it from note joins the
ALTER already there. Adjustment notes are free text, not labels, and are
left alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 17:42:22 -04:00
..
01_schema.sql Expose load segments and adjustment notes as separate pivot columns 2026-09-16 17:42:22 -04:00
02_auth.sql Put the app behind a login 2026-09-14 22:20:25 -04:00
gen_dim_period.sql Add dim_group to col_meta and pf.dim_period calendar table 2026-05-23 01:46:16 -04:00