From d834dd60b715422dc2a900fb2744f9c278a9830f Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Thu, 19 Jan 2023 15:22:13 +0800 Subject: [PATCH] Remove unnecessary code --- schema/schema.go | 8 -------- tests/go.mod | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/schema/schema.go b/schema/schema.go index 21e71c21..b34383bd 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -246,14 +246,6 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam field.HasDefaultValue = true field.AutoIncrement = true } - case String: - if _, ok := field.TagSettings["PRIMARYKEY"]; !ok { - if !field.HasDefaultValue || field.DefaultValueInterface != nil { - schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field) - } - - field.HasDefaultValue = true - } } } diff --git a/tests/go.mod b/tests/go.mod index acc0cf0e..251aabb3 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -7,12 +7,11 @@ require ( github.com/jinzhu/now v1.1.5 github.com/lib/pq v1.10.7 github.com/mattn/go-sqlite3 v1.14.16 // indirect - github.com/microsoft/go-mssqldb v0.19.0 // indirect golang.org/x/crypto v0.5.0 // indirect gorm.io/driver/mysql v1.4.5 gorm.io/driver/postgres v1.4.6 gorm.io/driver/sqlite v1.4.4 - gorm.io/driver/sqlserver v1.4.1 + gorm.io/driver/sqlserver v1.4.2 gorm.io/gorm v1.24.3 )