Commit 7134ad48 authored by Steven's avatar Steven

chore: fix migration history

parent fbdfaf85
...@@ -147,9 +147,11 @@ func (s *Store) preMigrate(ctx context.Context) error { ...@@ -147,9 +147,11 @@ func (s *Store) preMigrate(ctx context.Context) error {
return errors.Wrap(err, "failed to upsert migration history") return errors.Wrap(err, "failed to upsert migration history")
} }
} }
if s.Profile.Mode == "prod" {
if err := s.normalizedMigrationHistoryList(ctx); err != nil { if err := s.normalizedMigrationHistoryList(ctx); err != nil {
return errors.Wrap(err, "failed to normalize migration history list") return errors.Wrap(err, "failed to normalize migration history list")
} }
}
return nil return nil
} }
...@@ -270,7 +272,7 @@ func (s *Store) normalizedMigrationHistoryList(ctx context.Context) error { ...@@ -270,7 +272,7 @@ func (s *Store) normalizedMigrationHistoryList(ctx context.Context) error {
if err != nil { if err != nil {
return errors.Wrap(err, "failed to get schema version of migrate script") 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] latestSchemaVersion := schemaVersionMap[latestMinorVersion]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment