diff --git a/server/services/store/sqlstore/schema_table_migration.go b/server/services/store/sqlstore/schema_table_migration.go index 2ab075658..7a6f911dd 100644 --- a/server/services/store/sqlstore/schema_table_migration.go +++ b/server/services/store/sqlstore/schema_table_migration.go @@ -123,6 +123,10 @@ func (s *SQLStore) isSchemaMigrationNeeded() (bool, error) { "TABLE_NAME": s.tablePrefix + "schema_migrations", }) + if s.dbType == model.MysqlDBType { + query = query.Where(sq.Eq{"TABLE_SCHEMA": s.schemaName}) + } + rows, err := query.Query() if err != nil { s.logger.Error("failed to fetch columns in schema_migrations table", mlog.Err(err))