Print a helpful message for JSON column update failures. (#18041)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
370321a823
Коммит
f2119d60fa
@@ -920,7 +920,11 @@ func (ss *SqlStore) AlterColumnTypeIfExists(tableName string, columnName string,
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
mlog.Critical("Failed to alter column type", mlog.Err(err))
|
||||
msg := "Failed to alter column type."
|
||||
if mySqlColType == "JSON" && postgresColType == "jsonb" {
|
||||
msg += " It is likely you have invalid JSON values in the column. Please fix the values manually and run the migration again."
|
||||
}
|
||||
mlog.Critical(msg, mlog.Err(err))
|
||||
time.Sleep(time.Second)
|
||||
os.Exit(ExitAlterColumn)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user