The script looks correct, but the realtime publication might fail if the table is already added. Let me fix the script to be more idempotent:
Also need to make the policies idempotent:
Let me try using the Supabase tool to run the query directly:
I'll use the supabase_apply_migration tool for DDL operations:
Now I can use the tool directly via the already-provided supabase_apply_migration function: