From c0f20085a5e95ee01a21458bcd5c54b4802ccbb1 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Sep 2024 22:39:36 +0800 Subject: [PATCH] Apply suggestions from code review --- cmd/db.go | 4 +++- internal/db/reset/reset_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/db.go b/cmd/db.go index 9fd6c9014..23e9d1c4e 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -189,7 +189,9 @@ var ( Use: "reset", Short: "Resets the local database to current migrations", RunE: func(cmd *cobra.Command, args []string) error { - utils.Config.Db.Seed.Enabled = !noSeed + if noSeed { + utils.Config.Db.Seed.Enabled = false + } return reset.Run(cmd.Context(), migrationVersion, flags.DbConfig, afero.NewOsFs()) }, } diff --git a/internal/db/reset/reset_test.go b/internal/db/reset/reset_test.go index d155ed2ee..03da968c5 100644 --- a/internal/db/reset/reset_test.go +++ b/internal/db/reset/reset_test.go @@ -356,6 +356,7 @@ func TestResetRemote(t *testing.T) { // Check error assert.NoError(t, err) }) + t.Run("resets remote database with seed config disabled", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs()