Migrate System store to Sync by default (#10838)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3e6fed8df4
Коммит
f8a89a52fc
@@ -95,7 +95,7 @@ func UpgradeDatabase(sqlStore SqlStore, currentModelVersionString string) error
|
||||
|
||||
// Assume a fresh database if no schema version has been recorded.
|
||||
if currentSchemaVersion == nil {
|
||||
if result := <-sqlStore.System().SaveOrUpdate(&model.System{Name: "Version", Value: currentModelVersion.String()}); result.Err != nil {
|
||||
if err := sqlStore.System().SaveOrUpdate(&model.System{Name: "Version", Value: currentModelVersion.String()}); err != nil {
|
||||
return errors.Wrap(err, "failed to initialize schema version for fresh database")
|
||||
}
|
||||
|
||||
@@ -160,8 +160,8 @@ func UpgradeDatabase(sqlStore SqlStore, currentModelVersionString string) error
|
||||
}
|
||||
|
||||
func saveSchemaVersion(sqlStore SqlStore, version string) {
|
||||
if result := <-sqlStore.System().SaveOrUpdate(&model.System{Name: "Version", Value: version}); result.Err != nil {
|
||||
mlog.Critical(result.Err.Error())
|
||||
if err := sqlStore.System().SaveOrUpdate(&model.System{Name: "Version", Value: version}); err != nil {
|
||||
mlog.Critical(err.Error())
|
||||
time.Sleep(time.Second)
|
||||
os.Exit(EXIT_VERSION_SAVE)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user