mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Print a helpful message for JSON column update failures. (#18041)
Automatic Merge
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user