From f7fe3f755dd398c3f67dfc4ceb3d1dd91b903ed5 Mon Sep 17 00:00:00 2001 From: Horacio Duran Date: Wed, 20 Sep 2017 10:40:33 -0300 Subject: [PATCH] Skip ModifyColumnType test on incompatible DBs Some DB Engines don't fully support alter table so we skip when the dialect does not correspond to one of the ones that are known to support it. --- migration_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration_test.go b/migration_test.go index 193ea6f8..3f3a5c8f 100644 --- a/migration_test.go +++ b/migration_test.go @@ -5,6 +5,7 @@ import ( "database/sql/driver" "errors" "fmt" + "os" "reflect" "testing" "time" @@ -434,6 +435,13 @@ func TestMultipleIndexes(t *testing.T) { } func TestModifyColumnType(t *testing.T) { + dialect := os.Getenv("GORM_DIALECT") + if dialect != "postgres" && + dialect != "mysql" && + dialect != "mssql" { + t.Skip("Skipping this because only postgres, mysql and mssql support altering a column type") + } + type ModifyColumnType struct { gorm.Model Name1 string `gorm:"length:100"`