diff --git a/tests/go.mod b/tests/go.mod index 35db92e6..0cd03637 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,17 +3,16 @@ module gorm.io/gorm/tests go 1.14 require ( - github.com/denisenkom/go-mssqldb v0.12.0 // indirect github.com/google/uuid v1.3.0 github.com/jackc/pgx/v4 v4.15.0 // indirect github.com/jinzhu/now v1.1.4 github.com/lib/pq v1.10.4 github.com/mattn/go-sqlite3 v1.14.11 // indirect golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - gorm.io/driver/mysql v1.2.3 - gorm.io/driver/postgres v1.2.3 - gorm.io/driver/sqlite v1.2.6 - gorm.io/driver/sqlserver v1.2.1 + gorm.io/driver/mysql v1.3.0 + gorm.io/driver/postgres v1.3.0 + gorm.io/driver/sqlite v1.3.0 + gorm.io/driver/sqlserver v1.3.0 gorm.io/gorm v1.22.5 ) diff --git a/tests/migrate_test.go b/tests/migrate_test.go index 83ae4314..5e9c01fa 100644 --- a/tests/migrate_test.go +++ b/tests/migrate_test.go @@ -313,8 +313,9 @@ func TestMigrateIndexes(t *testing.T) { } func TestMigrateColumns(t *testing.T) { - fullSupported := map[string]bool{"sqlite": true, "mysql": true, "postgres": true}[DB.Dialector.Name()] + fullSupported := map[string]bool{"sqlite": true, "mysql": true, "postgres": true, "sqlserver": true}[DB.Dialector.Name()] sqlite := DB.Dialector.Name() == "sqlite" + sqlserver := DB.Dialector.Name() == "sqlserver" type ColumnStruct struct { gorm.Model @@ -362,10 +363,9 @@ func TestMigrateColumns(t *testing.T) { if v, ok := columnType.DefaultValue(); (fullSupported || ok) && v != "18" { t.Fatalf("column age default value should be correct, name: %v, column: %#v", columnType.Name(), columnType) } - if v, ok := columnType.Comment(); ((fullSupported && !sqlite) || ok) && v != "my age" { + if v, ok := columnType.Comment(); ((fullSupported && !sqlite && !sqlserver) || ok) && v != "my age" { t.Fatalf("column age comment should be correct, name: %v, column: %#v", columnType.Name(), columnType) } - case "code": if v, ok := columnType.Unique(); (fullSupported || ok) && !v { t.Fatalf("column code unique should be correct, name: %v, column: %#v", columnType.Name(), columnType)