mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
642 B
SQL
18 lines
642 B
SQL
|
|
CREATE TABLE public.bill_comments (
|
|
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
|
|
bill_id UUID NOT NULL REFERENCES public.bills(id) ON DELETE CASCADE,
|
|
user_id UUID NOT NULL,
|
|
user_name TEXT NOT NULL DEFAULT '',
|
|
comment TEXT NOT NULL,
|
|
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
|
|
);
|
|
|
|
ALTER TABLE public.bill_comments ENABLE ROW LEVEL SECURITY;
|
|
|
|
CREATE POLICY "Authenticated users can read bill comments"
|
|
ON public.bill_comments FOR SELECT TO authenticated USING (true);
|
|
|
|
CREATE POLICY "Authenticated users can insert bill comments"
|
|
ON public.bill_comments FOR INSERT TO authenticated WITH CHECK (true);
|