Display tableName and columnName for jsonb schema failures (#18672)

These are incredibly helpful during failures and should be there.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-10-13 20:30:35 +05:30
коммит произвёл GitHub
родитель 6521b0dfe3
Коммит e2c87ef950

Просмотреть файл

@@ -873,10 +873,15 @@ func (ss *SqlStore) AlterColumnTypeIfExists(tableName string, columnName string,
if err != nil {
msg := "Failed to alter column type."
fields := []mlog.Field{mlog.Err(err)}
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."
fields = append(fields,
mlog.String("tableName", tableName),
mlog.String("columnName", columnName),
)
}
mlog.Fatal(msg, mlog.Err(err))
mlog.Fatal(msg, fields...)
}
return true