Updates the check for the schema_migrations information (#23032)

The old check was using `sq.Eq`, which replaces its values with
strings, and for the case of `table_schema` we want to call a
function.
Этот коммит содержится в:
Miguel de la Cruz
2023-04-21 10:44:52 +02:00
коммит произвёл GitHub
родитель 344e882f04
Коммит 041cbe2d24

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

@@ -126,7 +126,7 @@ func (s *SQLStore) isSchemaMigrationNeeded() (bool, error) {
case model.MysqlDBType:
query = query.Where(sq.Eq{"TABLE_SCHEMA": s.schemaName})
case model.PostgresDBType:
query = query.Where(sq.Eq{"TABLE_SCHEMA": "current_schema()"})
query = query.Where("table_schema = current_schema()")
}
rows, err := query.Query()