[MM-58341] db/migrations: mysql-8.4 fix for 000027_create_status (#27080)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2024-06-05 18:52:53 +02:00
коммит произвёл GitHub
родитель 53bd7a73a4
Коммит 179d28ee3f
3 изменённых файлов: 21 добавлений и 7 удалений

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

@@ -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
}