mirror of
https://github.com/usememos/memos.git
synced 2024-09-20 14:35:54 +08:00
chore: fix migration history
This commit is contained in:
parent
fbdfaf85d9
commit
7134ad4883
|
@ -147,8 +147,10 @@ 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 err := s.normalizedMigrationHistoryList(ctx); err != nil {
|
if s.Profile.Mode == "prod" {
|
||||||
return errors.Wrap(err, "failed to normalize migration history list")
|
if err := s.normalizedMigrationHistoryList(ctx); err != nil {
|
||||||
|
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 {
|
||||||
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]
|
||||||
|
|
Loading…
Reference in a new issue