This commit is contained in:
Arthur Belleville 2025-06-28 14:50:19 +02:00
parent 5dca273fd6
commit fc173694fc
No known key found for this signature in database

View file

@ -0,0 +1,16 @@
-- Create feedback table
CREATE TABLE IF NOT EXISTS feedbacks (
id SERIAL PRIMARY KEY,
fd_type VARCHAR(20) NOT NULL CHECK (fd_type IN ('bug', 'feature', 'improvement', 'other')),
user_id UUID NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
-- Enable Row Level Security
ALTER TABLE feedbacks ENABLE ROW LEVEL SECURITY;
create policy "Users can insert feedback."
on feedbacks for insert
to authenticated
with check ( (select auth.uid()) = user_id );