Skip to content

Commit 3c64e6e

Browse files
committed
docs(schema): document shows.legacy_dj_name DJ_HANDLE invariant (BS#1393)
Inline column docstring captures the PII contract for shows.legacy_dj_name: the source is tubafrenzy DJ_HANDLE (the alias), not DJ_NAME (the full real name), and the value lands on the public marker dj_name wire via the resolveShow COALESCE fallback. Aligns new writers with the canonical flowsheet-etl source.
1 parent 9378df9 commit 3c64e6e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

shared/database/src/schema.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,20 @@ export const shows = wxyc_schema.table(
11721172
primary_dj_id: varchar('primary_dj_id', { length: 255 }).references(() => user.id, { onDelete: 'set null' }),
11731173
specialty_id: integer('specialty_id').references(() => specialty_shows.id),
11741174
legacy_show_id: integer('legacy_show_id'),
1175+
/**
1176+
* On-air DJ alias for the show, sourced from tubafrenzy's
1177+
* `FLOWSHEET_RADIO_SHOW_PROD.DJ_HANDLE` column (NOT `DJ_NAME` — that's the
1178+
* full real name BS forwards through the legacy mirror as `realName || name`
1179+
* and surfacing it on the public v2 wire would be PII exposure; see BS#1393).
1180+
*
1181+
* The marker `flowsheet.dj_name` resolver (apps/backend/routes/internal.route.ts
1182+
* via `resolveShow`'s COALESCE chain) reads this column as the fallback when
1183+
* `auth_user.dj_name` is NULL. Anything you write here lands on the public
1184+
* marker dj_name wire on the next webhook delivery — never write
1185+
* `auth_user.name` or any other full-name source. The flowsheet ETL writers
1186+
* (`jobs/flowsheet-etl/fetch-legacy.ts` and `jobs/flowsheet-etl/backfill-legacy-ids.ts`)
1187+
* are the canonical writers; align any new writer with their `DJ_HANDLE` source.
1188+
*/
11751189
legacy_dj_name: varchar('legacy_dj_name', { length: 128 }),
11761190
legacy_dj_id: integer('legacy_dj_id'),
11771191
/**

0 commit comments

Comments
 (0)