mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
Fix table_schema check for postgres (#4724)
This commit is contained in:
parent
55ba9d8624
commit
df5456adc0
@ -123,6 +123,13 @@ func (s *SQLStore) isSchemaMigrationNeeded() (bool, error) {
|
|||||||
"TABLE_NAME": s.tablePrefix + "schema_migrations",
|
"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()
|
rows, err := query.Query()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Error("failed to fetch columns in schema_migrations table", mlog.Err(err))
|
s.logger.Error("failed to fetch columns in schema_migrations table", mlog.Err(err))
|
||||||
|
Loading…
Reference in New Issue
Block a user