diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index 368ee7228..14d1803e2 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -74,4 +74,14 @@ begin loop execute format('drop policy if exists %I on %I.%I cascade', rec.policyname, rec.schemaname, rec.tablename); end loop; + + -- publications + for rec in + select * + from pg_publication p + where + p.pubname != 'supabase_realtime' + loop + execute format('drop publication if exists %I', rec.pubname); + end loop; end $$;