topfans/backend/migrations/20260713_add_mailbox_unread_counts.sql
2026-07-14 21:59:15 +08:00

12 lines
516 B
SQL

-- 20260713_add_mailbox_unread_counts.sql
-- 给 notification_stats 加 3 列,业务 emitter 用。
-- 幂等:重复执行无副作用(IF NOT EXISTS)。
ALTER TABLE public.notification_stats
ADD COLUMN IF NOT EXISTS feedback_replied_unread_count INT NOT NULL DEFAULT 0;
ALTER TABLE public.notification_stats
ADD COLUMN IF NOT EXISTS report_resolved_unread_count INT NOT NULL DEFAULT 0;
ALTER TABLE public.notification_stats
ADD COLUMN IF NOT EXISTS target_reported_unread_count INT NOT NULL DEFAULT 0;