From 1a1e908dd9a89a2887a26250c70726332256fafa Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 22 Oct 2024 00:27:42 +0800 Subject: [PATCH] fix: drop user created publications during reset (#2789) Co-authored-by: billysutomo --- pkg/migration/queries/drop.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 $$;