[MM-58341] db/migrations: mysql-8.4 fix for 000027_create_status (#27080)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
53bd7a73a4
Коммит
179d28ee3f
@@ -5,6 +5,7 @@ package sqlstore
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -197,3 +198,16 @@ func maxInt64(a, b int64) int64 {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Adds backtiks to the column name for MySQL, this is required if
|
||||
// the column name is a reserved keyword.
|
||||
//
|
||||
// `ColumnName` - MySQL
|
||||
// ColumnName - Postgres
|
||||
func quoteColumnName(driver string, columnName string) string {
|
||||
if driver == model.DatabaseDriverMysql {
|
||||
return fmt.Sprintf("`%s`", columnName)
|
||||
}
|
||||
|
||||
return columnName
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user