From 7134ad488301745307577a7d65efa9672e7ebd65 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 27 Aug 2024 09:20:23 +0800 Subject: [PATCH] chore: fix migration history --- store/migrator.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/store/migrator.go b/store/migrator.go index b965238f0..05ee466ad 100644 --- a/store/migrator.go +++ b/store/migrator.go @@ -147,8 +147,10 @@ func (s *Store) preMigrate(ctx context.Context) error { return errors.Wrap(err, "failed to upsert migration history") } } - if err := s.normalizedMigrationHistoryList(ctx); err != nil { - return errors.Wrap(err, "failed to normalize migration history list") + if s.Profile.Mode == "prod" { + if err := s.normalizedMigrationHistoryList(ctx); err != nil { + return errors.Wrap(err, "failed to normalize migration history list") + } } return nil } @@ -270,7 +272,7 @@ func (s *Store) normalizedMigrationHistoryList(ctx context.Context) error { if err != nil { return errors.Wrap(err, "failed to get schema version of migrate script") } - schemaVersionMap[version.GetMinorVersion((fileSchemaVersion))] = fileSchemaVersion + schemaVersionMap[version.GetMinorVersion(fileSchemaVersion)] = fileSchemaVersion } latestSchemaVersion := schemaVersionMap[latestMinorVersion]