File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,36 @@ If you modify the CloudSync source code, rebuild the CLI image and restart:
199199make postgres-supabase-rebuild SUPABASE_WORKDIR=~ /supabase-local
200200```
201201
202+ ### Supabase Realtime Migration Error (app_schema_version)
203+
204+ If Supabase Realtime fails to start with:
205+
206+ ```
207+ ERROR 42P01 (undefined_table) relation "app_schema_version" does not exist
208+ ```
209+
210+ it's caused by CloudSync's ` app_schema_change ` event trigger firing during
211+ migrations while Realtime uses a restricted ` search_path ` . Fix it by
212+ fully qualifying the table in the trigger function:
213+
214+ ``` sql
215+ CREATE TABLE IF NOT EXISTS public .app_schema_version (
216+ version BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
217+ );
218+
219+ CREATE OR REPLACE FUNCTION bump_app_schema_version ()
220+ RETURNS event_trigger AS $$
221+ BEGIN
222+ INSERT INTO public .app_schema_version DEFAULT VALUES ;
223+ END;
224+ $$ LANGUAGE plpgsql;
225+
226+ DROP EVENT TRIGGER IF EXISTS app_schema_change;
227+ CREATE EVENT TRIGGER app_schema_change
228+ ON ddl_command_end
229+ EXECUTE FUNCTION bump_app_schema_version();
230+ ```
231+
202232## Development Workflow
203233
204234### 1. Make Changes
You can’t perform that action at this time.
0 commit comments