Skip to content

Commit

Permalink
fix: include more schemas in data only dump
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Oct 2, 2023
1 parent e59da80 commit dd5fe56
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions internal/db/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,25 @@ 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",
// Managed by Supabase
// "auth",
"extensions",
"pgbouncer",
Expand All @@ -74,7 +92,7 @@ func dumpData(ctx context.Context, config pgconn.Config, schema []string, useCop
"_analytics",
// "supabase_functions",
"supabase_migrations",
}, utils.SystemSchemas...)
}
env := []string{"EXCLUDED_SCHEMAS=" + strings.Join(excludedSchemas, "|")}
if len(schema) > 0 {
env[0] = "INCLUDED_SCHEMAS=" + strings.Join(schema, "|")
Expand Down

0 comments on commit dd5fe56

Please sign in to comment.