|
Hello! We're building our MVP using Supabase. Our structure is that each one of the companies that pay to use our platform will be containerized, running in their own virtual instance with their own version of Supabase locally installed in that VM. Our biggest concern is how we're going to manage updates and database changes. I've been able to use pgAdmin and its Schema Diff tool to handle migrations manually between databases, by pasting the changes into the browser's SQL Editor. I'd assume I can automate this, and I've seen some forum posts showing it. However, it seems like realtime gets disabled (or never gets enabled) when a new table is imported (even if it is enabled in the database that the schema changes are coming from). I will say that I am using the public schema; if there is another schema that handles realtime, I could just be missing that one. TLDR; Is there a way to enable realtime for a table via the Supabase CLI? I'm looking to automate the process using a bash script. Thanks for your help!! |
Replies: 1 comment 7 replies
|
Hey @nbarrow-inspire-labs! Sorry to hear you're hitting this. Just to confirm, does the PG https://supabase.com/docs/guides/realtime/extensions/postgres-changes#replication-setup Each table will also need to be added to that -- add a table to the publication
alter
publication supabase_realtime add table messages; |
@nbarrow-inspire-labs I just went down the rabbit hole trying to make sense of this one. I was able to reproduce the same error
syntax error at or near "TABLES"on PG v15.1 when executing from the studio SQL editor.Turns out there is some minor sanitization happening in the studio sql editor which I believe is preventing this (this should get fixed at some point - see constructive-io/pgsql-parser#93). However even if you connect to your DB directly (eg. via
psqlCLI), you will get:ERROR: must be superuser to add or set schemas. Seems likesuperuseris required to perform this, which isn't available at this time for security reasons (see https://github.com/orgs/supabase/discussions/9314).…