From 6eb9642fff9417b72dc99d7410621b55710c099e Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Fri, 24 Oct 2025 16:58:57 +0800 Subject: [PATCH 1/2] fix: 2nd pass when pulling initial schema --- internal/db/pull/pull.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/db/pull/pull.go b/internal/db/pull/pull.go index 1ea776e80..b55b6935c 100644 --- a/internal/db/pull/pull.go +++ b/internal/db/pull/pull.go @@ -24,10 +24,9 @@ import ( ) var ( - errMissing = errors.New("No migrations found") - errInSync = errors.New("No schema changes found") - errConflict = errors.Errorf("The remote database's migration history does not match local files in %s directory.", utils.MigrationsDir) - managedSchemas = []string{"auth", "storage", "realtime"} + errMissing = errors.New("No migrations found") + errInSync = errors.New("No schema changes found") + errConflict = errors.Errorf("The remote database's migration history does not match local files in %s directory.", utils.MigrationsDir) ) func Run(ctx context.Context, schema []string, config pgconn.Config, name string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -61,8 +60,8 @@ func run(ctx context.Context, schema []string, path string, conn *pgx.Conn, fsys if err = dumpRemoteSchema(ctx, path, config, fsys); err != nil { return err } - // Pull changes in managed schemas automatically - if err = diffRemoteSchema(ctx, managedSchemas, path, config, fsys); errors.Is(err, errInSync) { + // Run a second pass to pull in changes from default privileges and managed schemas + if err = diffRemoteSchema(ctx, nil, path, config, fsys); errors.Is(err, errInSync) { err = nil } return err From d8245d790d589d8734d693dafcbc0efeec96b808 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Fri, 24 Oct 2025 17:07:50 +0800 Subject: [PATCH 2/2] chore: deprecate reset all from dump script --- pkg/migration/scripts/dump_schema.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/migration/scripts/dump_schema.sh b/pkg/migration/scripts/dump_schema.sh index 7f61c5866..d7fa91f7f 100755 --- a/pkg/migration/scripts/dump_schema.sh +++ b/pkg/migration/scripts/dump_schema.sh @@ -53,6 +53,3 @@ pg_dump \ | sed -E 's/^ALTER TABLE "cron"/-- &/' \ | sed -E 's/^SET transaction_timeout = 0;/-- &/' \ | sed -E "${EXTRA_SED:-}" - -# Reset session config generated by pg_dump -echo "RESET ALL;"