From 355bfd4984d308970708f83a358f193c96330ead Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 30 Jan 2025 12:22:31 +0800 Subject: [PATCH] fix: clean up storage schema on db reset (#3083) --- pkg/migration/queries/drop.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index 6dd8d8647..71564659c 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -33,12 +33,13 @@ begin execute format('drop table if exists %I.%I cascade', rec.relnamespace::regnamespace::name, rec.relname); end loop; - -- truncate tables in auth, webhooks, and migrations schema + -- truncate tables in auth, storage, webhooks, and migrations schema for rec in select * from pg_class c where (c.relnamespace::regnamespace::name = 'auth' and c.relname != 'schema_migrations' + or c.relnamespace::regnamespace::name = 'storage' and c.relname != 'migrations' or c.relnamespace::regnamespace::name = 'supabase_functions' and c.relname != 'migrations' or c.relnamespace::regnamespace::name = 'supabase_migrations') and c.relkind = 'r'