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.
This commit is contained in:
Horacio Duran 2017-09-20 10:40:33 -03:00
parent c5d9620984
commit f7fe3f755d

View File

@ -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"`