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
573 B
SQL
1 line
No EOL
573 B
SQL
-- This snippet checks if the messages table is already part of the publication before attempting to add it.
|
|
|
|
|
|
-- Enable replication for the messages table
|
|
|
|
ALTER TABLE public.messages REPLICA IDENTITY FULL;
|
|
|
|
|
|
-- Check if the messages table is already part of the publication
|
|
|
|
DO
|
|
$$
|
|
|
|
BEGIN
|
|
|
|
IF
|
|
NOT EXISTS (
|
|
|
|
SELECT 1
|
|
|
|
FROM pg_publication_tables
|
|
|
|
WHERE pubname = 'supabase_realtime' AND schemaname = 'public' AND tablename = 'messages'
|
|
|
|
) THEN
|
|
|
|
ALTER
|
|
PUBLICATION supabase_realtime
|
|
|
|
ADD TABLE public.messages;
|
|
|
|
END IF;
|
|
|
|
END $$; |