fixed comments count in citizen portal

This commit is contained in:
2026-04-28 15:15:33 +02:00
parent 879d7c5858
commit b18811c453
4 changed files with 87 additions and 8 deletions

View File

@@ -0,0 +1,14 @@
-- =====================================================================
-- Migration 007: Adds Status Column to Comments for Moderation
-- =====================================================================
-- Adds Status Column with Default 'pending'
ALTER TABLE comments
ADD COLUMN status VARCHAR(20) NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'approved', 'rejected'));
-- Index for fast Status Filtering
CREATE INDEX idx_comments_status ON comments(status);
-- Sets all existing Comments to 'approved' (retroactive)
UPDATE comments SET status = 'approved';