1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-21 13:38:56 +02:00

Fix table_schema check for postgres (#4724)

This commit is contained in:
Miguel de la Cruz 2023-04-26 22:37:27 +02:00 committed by GitHub
parent 55ba9d8624
commit df5456adc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,6 +123,13 @@ func (s *SQLStore) isSchemaMigrationNeeded() (bool, error) {
"TABLE_NAME": s.tablePrefix + "schema_migrations",
})
switch s.dbType {
case model.MysqlDBType:
query = query.Where(sq.Eq{"TABLE_SCHEMA": s.schemaName})
case model.PostgresDBType:
query = query.Where("table_schema = current_schema()")
}
rows, err := query.Query()
if err != nil {
s.logger.Error("failed to fetch columns in schema_migrations table", mlog.Err(err))