diff --git a/tests/helper_test.go b/tests/helper_test.go index c34e357cf..1a4874eeb 100644 --- a/tests/helper_test.go +++ b/tests/helper_test.go @@ -265,6 +265,10 @@ func isTiDB() bool { return os.Getenv("GORM_DIALECT") == "tidb" } +func isMysql() bool { + return os.Getenv("GORM_DIALECT") == "mysql" +} + func db(unscoped bool) *gorm.DB { if unscoped { return DB.Unscoped() diff --git a/tests/migrate_test.go b/tests/migrate_test.go index 933ea5e0c..849e2b7bd 100644 --- a/tests/migrate_test.go +++ b/tests/migrate_test.go @@ -1601,7 +1601,7 @@ func TestMigrateExistingBoolColumnPG(t *testing.T) { func TestTableType(t *testing.T) { // currently it is only supported for mysql driver - if DB.Dialector.Name() != "mysql" { + if !isMysql() { return }