Files
spsays-bff/migrations/0038_admin_panel.up.sql
2026-06-16 14:47:45 +05:30

16 lines
791 B
SQL

-- Admin panel support. All additive — existing columns/queries are untouched,
-- so the public API and the existing frontend keep working unchanged.
-- Feedback replies: an admin can write a reply that gets emailed to the
-- submitter. reply_message holds the text, replied_at stamps when it was sent
-- (one-way, like resolved_at). Replying also resolves the row.
ALTER TABLE feedback
ADD COLUMN IF NOT EXISTS reply_message TEXT,
ADD COLUMN IF NOT EXISTS replied_at TIMESTAMPTZ;
-- Admin → user direct messages reuse the notifications feed. Event-driven
-- notifications carry no free text, so add an optional body column that only
-- the 'admin_message' kind populates (all existing kinds leave it NULL).
ALTER TABLE notifications
ADD COLUMN IF NOT EXISTS body TEXT;