From b03f4861d3d1a91b43ee74083bffcbd7c3bcda01 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 2 Oct 2023 12:44:38 +0800 Subject: [PATCH] fix: include more schemas in data only dump --- internal/db/dump/dump.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index aeb7c07b1..d1fdf7006 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -64,7 +64,24 @@ func DumpSchema(ctx context.Context, config pgconn.Config, schema []string, keep func dumpData(ctx context.Context, config pgconn.Config, schema []string, useCopy, dryRun bool, stdout io.Writer) error { // We want to dump user data in auth, storage, etc. for migrating to new project - excludedSchemas := append([]string{ + excludedSchemas := []string{ + "information_schema", + "pg_*", // Wildcard pattern follows pg_dump + // Owned by extensions + // "cron", + "graphql", + "graphql_public", + // "net", + // "pgsodium", + // "pgsodium_masks", + "pgtle", + "repack", + "tiger", + "tiger_data", + "timescaledb_*", + "_timescaledb_*", + "topology", + // "vault", // "auth", "extensions", "pgbouncer", @@ -73,8 +90,8 @@ func dumpData(ctx context.Context, config pgconn.Config, schema []string, useCop // "storage", "_analytics", // "supabase_functions", - "supabase_migrations", - }, utils.SystemSchemas...) + // "supabase_migrations", + } env := []string{"EXCLUDED_SCHEMAS=" + strings.Join(excludedSchemas, "|")} if len(schema) > 0 { env[0] = "INCLUDED_SCHEMAS=" + strings.Join(schema, "|")