sipher/supabase/sql_snippets/User Requests and Messages Management.sql
Nixyi 8b27c6b140 Stable Release (I think)
Added all SQL scripts by using a python script to fetch them.

Also added a "About" page and a skeleton to the chat page.

Fixed the register function that was not setting the public_key on the database
2024-12-18 16:08:06 -03:00

1 line
No EOL
397 B
SQL

-- Add requests array to users table
ALTER TABLE public.users
ADD COLUMN requests TEXT[] DEFAULT ARRAY[]::TEXT[];
-- Create index for the requests array for better performance
CREATE INDEX idx_users_requests ON public.users USING GIN (requests);
-- Add policy for requests field
CREATE
POLICY "Users can only see their own requests" ON public.users FOR
SELECT
USING (auth.uid () = uuid);