test: tidb exclueded

This commit is contained in:
Saeid Saeidee 2023-08-02 23:34:35 +02:00
parent b0b7a57b9f
commit 71e3342b6d
2 changed files with 5 additions and 1 deletions

View File

@ -265,6 +265,10 @@ func isTiDB() bool {
return os.Getenv("GORM_DIALECT") == "tidb" return os.Getenv("GORM_DIALECT") == "tidb"
} }
func isMysql() bool {
return os.Getenv("GORM_DIALECT") == "mysql"
}
func db(unscoped bool) *gorm.DB { func db(unscoped bool) *gorm.DB {
if unscoped { if unscoped {
return DB.Unscoped() return DB.Unscoped()

View File

@ -1601,7 +1601,7 @@ func TestMigrateExistingBoolColumnPG(t *testing.T) {
func TestTableType(t *testing.T) { func TestTableType(t *testing.T) {
// currently it is only supported for mysql driver // currently it is only supported for mysql driver
if DB.Dialector.Name() != "mysql" { if !isMysql() {
return return
} }