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
1 line
No EOL
397 B
SQL
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); |