Unauthorized when using management api
OAuth2 app run sql error:SQL execution failed: │
Unauthorized"
SQL:
-- Drop existing policies if they exist to prevent errors on re-run
DROP POLICY IF EXISTS "Allow read access to everyone" ON public.messages;
DROP POLICY IF EXISTS "Allow insert access to everyone" ON public.messages;
-- Enable Row Level Security on the messages table
ALTER TABLE public.messages ENABLE ROW LEVEL SECURITY;
-- Create a policy to allow all users to read messages
-- This is necessary so that the chat client can display messages from the database.
-- The USING (true) clause means the policy is always permissive for SELECT operations.
CREATE POLICY "Allow read access to everyone"
ON public.messages
FOR SELECT
USING (true);
-- Create a policy to allow all users to insert new messages
-- This is necessary for users to be able to send messages.
-- The WITH CHECK (true) clause means the policy is always permissive for INSERT operations.
CREATE POLICY "Allow insert access to everyone"
ON public.messages
FOR INSERT
WITH CHECK (true)
1 Reply
does supabase Manage
ment API support DDLoperations?(ALTER TABLE, CREATE TABLE, DROP TABLE)