feat(feedback): snapshot the sender's language and connector bot at submit
Store the sender's interface language (lang) and, for a message that arrived through an external connector (Telegram), the bot language (channel_lang) on the feedback row at submit time, so the operator console shows the state as it was rather than the account's current settings (same snapshot discipline as a suspension reason). Added additively in migration 00005. The console detail reads these columns instead of loading the account live.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- +goose Up
|
||||
-- Snapshot the sender's languages on each feedback message, taken at submit time so the
|
||||
-- operator console shows the state as it was, not the account's current settings (the same
|
||||
-- snapshot discipline as a suspension's reason). lang is the sender's interface language;
|
||||
-- channel_lang is the connector bot language (en/ru) when the message arrived through an
|
||||
-- external connector (Telegram), else NULL. Additive over 00004 so it applies forward-safe.
|
||||
SET search_path = backend, pg_catalog;
|
||||
|
||||
ALTER TABLE feedback_messages ADD COLUMN lang text;
|
||||
ALTER TABLE feedback_messages ADD COLUMN channel_lang text;
|
||||
|
||||
-- +goose Down
|
||||
SET search_path = backend, pg_catalog;
|
||||
ALTER TABLE feedback_messages DROP COLUMN IF EXISTS channel_lang;
|
||||
ALTER TABLE feedback_messages DROP COLUMN IF EXISTS lang;
|
||||
Reference in New Issue
Block a user