Adds paliad.users.forum_pref so /tools/fristenrechner can pre-narrow the proceeding picker to the user's typical inbox channel without re-asking on every visit. The new column threads through the User model, the userColumns SELECT, and UpdateProfileInput so the existing PATCH /api/me handler accepts it without a new endpoint. Allowed values mirror the channel chips m named in t-paliad-157: - cms → UPC - bea → national-DE - posteingang → national-DE (slower channel, same forums) NULL means "no preference, picker shows everything"; URL ?inbox= overrides per-visit (frontend lands in the next commit). The CHECK constraint enforces the 3-value enum at the DB layer; isValidForumPref mirrors it in the service so callers see a typed error instead of a raw pq violation. Empty string in the PATCH body clears the preference, consistent with the EscalationContactID convention. Migration 064 applied to the live Supabase pool; tracker bumped to v64 so the boot-time runner skips re-applying. Refs m/paliad#15.
6 lines
245 B
SQL
6 lines
245 B
SQL
-- Reverse t-paliad-157 / m/paliad#15: drops the persisted
|
|
-- Fristenrechner inbox-channel preference column.
|
|
|
|
ALTER TABLE paliad.users DROP CONSTRAINT IF EXISTS users_forum_pref_check;
|
|
ALTER TABLE paliad.users DROP COLUMN IF EXISTS forum_pref;
|