Files
spsays-bff/migrations/0018_add_feedback_acknowledged_at.up.sql
T

18 lines
864 B
SQL

-- Track when a feedback row was acknowledged.
--
-- Acknowledgement is the intermediate state between "open" and
-- "resolved": the team has seen the feedback and (if it needs work) the
-- devs have started on it. The author gets an email saying so, with a
-- promise of a second email once it's actually fixed/implemented.
--
-- NULL = not yet acknowledged. Non-NULL = acknowledged at that moment.
-- Like resolved_at, the action is one-way and idempotent: the endpoint
-- enforces `WHERE acknowledged_at IS NULL` so the acknowledgement email
-- fires at most once.
--
-- The two columns are independent stamps. An admin may acknowledge then
-- later resolve (two emails), or resolve directly without acknowledging
-- (one email). Resolving does not require a prior acknowledgement.
ALTER TABLE feedback
ADD COLUMN IF NOT EXISTS acknowledged_at TIMESTAMPTZ;