feedback feature

This commit is contained in:
wass08
2026-02-18 10:26:57 +09:00
parent 1cceb50ab6
commit 9a2c89547b
8 changed files with 209 additions and 89 deletions
@@ -0,0 +1,24 @@
-- Create feedback table
CREATE TABLE IF NOT EXISTS feedback (
id TEXT NOT NULL PRIMARY KEY,
user_id TEXT,
message TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Enable Row Level Security
ALTER TABLE feedback ENABLE ROW LEVEL SECURITY;
-- Allow anyone (authenticated or anonymous) to submit feedback
CREATE POLICY "Anyone can insert feedback"
ON feedback
FOR INSERT
TO anon, authenticated
WITH CHECK (true);
-- Allow service role full access (for admin review)
CREATE POLICY "Service role full access"
ON feedback
TO service_role
USING (true)
WITH CHECK (true);