From 836c1873fae1eeb74ab20f95c96894d48f0ce122 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Wed, 15 Mar 2023 06:49:32 -0600 Subject: [PATCH] Merge pull request #4641 from sbishel/MM-51303-add-schema-check (#4643) Add schema check for schema migration (cherry picked from commit 5310193fa6a07cabe5174cc85f8376c5f7f1d13e) --- server/services/store/sqlstore/schema_table_migration.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/services/store/sqlstore/schema_table_migration.go b/server/services/store/sqlstore/schema_table_migration.go index cbabba697..ff393c110 100644 --- a/server/services/store/sqlstore/schema_table_migration.go +++ b/server/services/store/sqlstore/schema_table_migration.go @@ -121,6 +121,10 @@ func (s *SQLStore) isSchemaMigrationNeeded() (bool, error) { "COLUMN_NAME": "dirty", }) + if s.dbType == model.MysqlDBType { + query = query.Where(sq.Eq{"TABLE_SCHEMA": s.schemaName}) + } + row := query.QueryRow() var count int