-- Enable Realtime for chat_gateway_nodes table
-- This is required for WebSocket updates to work

begin;

-- 1. Add table to the publication
alter publication supabase_realtime add table chat_gateway_nodes;

-- 2. Ensure RLS is either disabled or has a policy allowing access
-- Option A: Disable RLS (Simplest for internal tools)
alter table chat_gateway_nodes disable row level security;

-- Option B: If you must keep RLS, add a policy for anonymous/authenticated users
-- create policy "Allow read access for all" on chat_gateway_nodes for select using (true);

commit;
