diff --git a/go.mod b/go.mod index b3aa79c1b..72fe9c2ed 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,6 @@ replace github.com/hashicorp/boundary/api => ./api replace github.com/hashicorp/boundary/sdk => ./sdk -// tmp use of local clone as we understand any required upstream PRs to -// compatibility. -replace gorm.io/gorm => github.com/hashicorp/gorm v0.0.2 - require ( github.com/armon/go-metrics v0.3.9 github.com/bufbuild/buf v0.37.0 @@ -83,7 +79,7 @@ require ( google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 google.golang.org/protobuf v1.27.1 gorm.io/driver/postgres v1.1.0 - gorm.io/gorm v1.21.14 + gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424 mvdan.cc/gofumpt v0.1.1 nhooyr.io/websocket v1.8.7 ) diff --git a/go.sum b/go.sum index f6431760e..632cd926c 100644 --- a/go.sum +++ b/go.sum @@ -538,8 +538,6 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/gorm v0.0.2 h1:yxEp0og8mswtQVSEnxEsU+d3QIvYDqU+P5ABAm0B9n4= -github.com/hashicorp/gorm v0.0.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -1518,6 +1516,9 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.1.0 h1:afBljg7PtJ5lA6YUWluV2+xovIPhS+YiInuL3kUjrbk= gorm.io/driver/postgres v1.1.0/go.mod h1:hXQIwafeRjJvUm+OMxcFWyswJ/vevcpPLlGocwAwuqw= +gorm.io/gorm v1.21.9/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424 h1:BIsspdRVnFmC32WxhF+4rvNu/mU/rbX9yK9a8vtJSqs= +gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= diff --git a/internal/db/README.md b/internal/db/README.md index 120bcc162..115a72324 100644 --- a/internal/db/README.md +++ b/internal/db/README.md @@ -7,9 +7,7 @@ Just some high-level usage highlights to get you started. Read the godocs for a dialect = postgres.New(postgres.Config{ DSN: connectionUrl}, ) - conn, _ := gorm.Open(dialect, &gorm.Config{ - ConvertNullToZeroValues: true, - }) + conn, _ := gorm.Open(dialect, &gorm.Config{}) // Db implements both the Reader and Writer interfaces rw := Db{Tx: conn} diff --git a/internal/db/db.go b/internal/db/db.go index e9aeaeba1..9586cd566 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -87,9 +87,7 @@ func Open(dbType DbType, connectionUrl string, opt ...Option) (*DB, error) { default: return nil, fmt.Errorf("unable to open %s database type", dbType) } - db, err := gorm.Open(dialect, &gorm.Config{ - ConvertNullToZeroValues: true, - }) + db, err := gorm.Open(dialect, &gorm.Config{}) if err != nil { return nil, fmt.Errorf("unable to open database: %w", err) } diff --git a/internal/oplog/oplog_test.go b/internal/oplog/oplog_test.go index 8a87d5eee..a022ccbf7 100644 --- a/internal/oplog/oplog_test.go +++ b/internal/oplog/oplog_test.go @@ -47,9 +47,7 @@ func testOpen(dbType string, connectionUrl string) (*gorm.DB, error) { default: return nil, fmt.Errorf("unable to open %s database type", dbType) } - db, err := gorm.Open(dialect, &gorm.Config{ - ConvertNullToZeroValues: true, - }) + db, err := gorm.Open(dialect, &gorm.Config{}) if err != nil { return nil, fmt.Errorf("unable to open database: %w", err) }