diff --git a/go.mod b/go.mod index b1f94ae6b..9545fde60 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/go-xmlfmt/xmlfmt v1.1.2 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/golangci/golangci-lint v1.61.0 - github.com/google/go-cmp v0.6.0 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -170,6 +169,7 @@ require ( github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gorilla/css v1.0.0 // indirect diff --git a/pkg/config/db.go b/pkg/config/db.go index e7c5f820b..7ce21fad0 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -3,7 +3,6 @@ package config import ( "bytes" - "github.com/google/go-cmp/cmp" v1API "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/diff" @@ -81,16 +80,6 @@ type ( } ) -// Compare two db config, if changes requires restart return true, return false otherwise -func (a settings) requireDbRestart(b settings) bool { - return !cmp.Equal(a.MaxConnections, b.MaxConnections) || - !cmp.Equal(a.MaxWorkerProcesses, b.MaxWorkerProcesses) || - !cmp.Equal(a.MaxParallelWorkers, b.MaxParallelWorkers) || - !cmp.Equal(a.MaxWalSenders, b.MaxWalSenders) || - !cmp.Equal(a.MaxReplicationSlots, b.MaxReplicationSlots) || - !cmp.Equal(a.SharedBuffers, b.SharedBuffers) -} - func (a *settings) ToUpdatePostgresConfigBody() v1API.UpdatePostgresConfigBody { body := v1API.UpdatePostgresConfigBody{} diff --git a/pkg/config/updater.go b/pkg/config/updater.go index 8dfcaa66e..b5db03f38 100644 --- a/pkg/config/updater.go +++ b/pkg/config/updater.go @@ -75,14 +75,7 @@ func (u *ConfigUpdater) UpdateDbSettingsConfig(ctx context.Context, projectRef s return nil } fmt.Fprintln(os.Stderr, "Updating DB service with config:", string(dbDiff)) - - remoteConfig := s.fromRemoteConfig(*dbConfig.JSON200) - restartRequired := s.requireDbRestart(remoteConfig) - if restartRequired { - fmt.Fprintln(os.Stderr, "Database will be restarted to apply config updates...") - } updateBody := s.ToUpdatePostgresConfigBody() - updateBody.RestartDatabase = &restartRequired if resp, err := u.client.V1UpdatePostgresConfigWithResponse(ctx, projectRef, updateBody); err != nil { return errors.Errorf("failed to update DB config: %w", err) } else if resp.JSON200 == nil {