From e2c87ef9504737e538344a17e75c07634caa8524 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 13 Oct 2021 20:30:35 +0530 Subject: [PATCH] Display tableName and columnName for jsonb schema failures (#18672) These are incredibly helpful during failures and should be there. ```release-note NONE ``` --- store/sqlstore/store.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/store/sqlstore/store.go b/store/sqlstore/store.go index 292f94d83d..875807265a 100644 --- a/store/sqlstore/store.go +++ b/store/sqlstore/store.go @@ -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