-- Check and set the publication

SELECT *
FROM pg_publication;


-- If not set correctly, reset it:

DROP
PUBLICATION IF EXISTS supabase_realtime;

CREATE
PUBLICATION supabase_realtime FOR ALL TABLES;



-- Enable FULL replica identity for our tables

ALTER TABLE public.users REPLICA IDENTITY FULL;

ALTER TABLE public.messages REPLICA IDENTITY FULL;

ALTER TABLE public.thread_participants REPLICA IDENTITY FULL;

ALTER TABLE public.message_threads REPLICA IDENTITY FULL;