diff --git a/Makefile b/Makefile index 07fcb015..04f59121 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include Makefile.buf -GENTOOL_IMAGE := infoblox/atlas-gentool:dev-gengorm +GENTOOL_IMAGE := infoblox/atlas-gentool:v21.13.2 GOPATH ?= $(HOME)/go SRCPATH := $(patsubst %/,%,$(GOPATH))/src diff --git a/docker/Dockerfile b/docker/Dockerfile index 74ec3f8d..2e3ed18c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /go/src/github.com/infobloxopen/protoc-gen-gorm COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -o /out/usr/bin/protoc-gen-gorm main.go -FROM infoblox/atlas-gentool:v25.1-6-g1ac2da0 AS runner +FROM infoblox/atlas-gentool:v21.13.2 AS runner COPY --from=builder /out/usr/bin/protoc-gen-gorm /usr/bin/protoc-gen-gorm COPY --from=builder /go/src/github.com/infobloxopen/protoc-gen-gorm/proto /go/src/github.com/infobloxopen/protoc-gen-gorm/proto diff --git a/example/feature_demo/demo_multi_file.pb.gorm.go b/example/feature_demo/demo_multi_file.pb.gorm.go index de9fef89..05a7fff0 100644 --- a/example/feature_demo/demo_multi_file.pb.gorm.go +++ b/example/feature_demo/demo_multi_file.pb.gorm.go @@ -5,9 +5,9 @@ import ( fmt "fmt" gateway "github.com/infobloxopen/atlas-app-toolkit/v2/gateway" errors "github.com/infobloxopen/protoc-gen-gorm/errors" + gorm "github.com/jinzhu/gorm" go_uuid "github.com/satori/go.uuid" field_mask "google.golang.org/genproto/protobuf/field_mask" - gorm "gorm.io/gorm" ) type ExternalChildORM struct { diff --git a/example/feature_demo/demo_multi_file_service.pb.gorm.go b/example/feature_demo/demo_multi_file_service.pb.gorm.go index 461e66ad..8e73ef87 100644 --- a/example/feature_demo/demo_multi_file_service.pb.gorm.go +++ b/example/feature_demo/demo_multi_file_service.pb.gorm.go @@ -2,7 +2,7 @@ package example import ( context "context" - gorm "gorm.io/gorm" + gorm "github.com/jinzhu/gorm" ) type BlogPostServiceDefaultServer struct { diff --git a/example/feature_demo/demo_service.pb.gorm.go b/example/feature_demo/demo_service.pb.gorm.go index a239b17b..11bce4ea 100644 --- a/example/feature_demo/demo_service.pb.gorm.go +++ b/example/feature_demo/demo_service.pb.gorm.go @@ -8,10 +8,10 @@ import ( gorm1 "github.com/infobloxopen/atlas-app-toolkit/v2/gorm" query "github.com/infobloxopen/atlas-app-toolkit/v2/query" errors "github.com/infobloxopen/protoc-gen-gorm/errors" + gorm "github.com/jinzhu/gorm" trace "go.opencensus.io/trace" field_mask "google.golang.org/genproto/protobuf/field_mask" emptypb "google.golang.org/protobuf/types/known/emptypb" - gorm "gorm.io/gorm" ) type IntPointORM struct { diff --git a/example/feature_demo/demo_types.pb.gorm.go b/example/feature_demo/demo_types.pb.gorm.go index d457d544..cb2d9d04 100644 --- a/example/feature_demo/demo_types.pb.gorm.go +++ b/example/feature_demo/demo_types.pb.gorm.go @@ -9,6 +9,7 @@ import ( errors "github.com/infobloxopen/protoc-gen-gorm/errors" user "github.com/infobloxopen/protoc-gen-gorm/example/user" types "github.com/infobloxopen/protoc-gen-gorm/types" + gorm "github.com/jinzhu/gorm" pq "github.com/lib/pq" go_uuid "github.com/satori/go.uuid" field_mask "google.golang.org/genproto/protobuf/field_mask" @@ -16,7 +17,6 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - gorm "gorm.io/gorm" big "math/big" strings "strings" time "time" diff --git a/example/postgres_arrays/postgres_arrays.pb.gorm.go b/example/postgres_arrays/postgres_arrays.pb.gorm.go index e7677554..4b79c0c8 100644 --- a/example/postgres_arrays/postgres_arrays.pb.gorm.go +++ b/example/postgres_arrays/postgres_arrays.pb.gorm.go @@ -5,9 +5,9 @@ import ( fmt "fmt" gateway "github.com/infobloxopen/atlas-app-toolkit/v2/gateway" errors "github.com/infobloxopen/protoc-gen-gorm/errors" + gorm "github.com/jinzhu/gorm" pq "github.com/lib/pq" field_mask "google.golang.org/genproto/protobuf/field_mask" - gorm "gorm.io/gorm" ) type ExampleORM struct { diff --git a/example/user/user.pb.gorm.go b/example/user/user.pb.gorm.go index f116da33..787af62a 100644 --- a/example/user/user.pb.gorm.go +++ b/example/user/user.pb.gorm.go @@ -8,9 +8,9 @@ import ( resource "github.com/infobloxopen/atlas-app-toolkit/v2/gorm/resource" auth "github.com/infobloxopen/protoc-gen-gorm/auth" errors "github.com/infobloxopen/protoc-gen-gorm/errors" + gorm "github.com/jinzhu/gorm" field_mask "google.golang.org/genproto/protobuf/field_mask" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - gorm "gorm.io/gorm" strings "strings" time "time" ) diff --git a/go.mod b/go.mod index fb2431f2..7a12b2c4 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/infobloxopen/atlas-app-toolkit/v2 v2.2.1-0.20240313220428-5449c0c2a27f github.com/jinzhu/inflection v1.0.0 + github.com/jinzhu/gorm v1.9.16 github.com/lib/pq v1.10.2 github.com/satori/go.uuid v1.2.0 go.opencensus.io v0.23.0 diff --git a/go.sum b/go.sum index b93e1edc..944b3213 100644 --- a/go.sum +++ b/go.sum @@ -889,6 +889,7 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= diff --git a/plugin/plugin.go b/plugin/plugin.go index ed466f1f..b7b3decd 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -33,7 +33,7 @@ var ( ) var ( - gormImport = "gorm.io/gorm" + gormImport = "github.com/jinzhu/gorm" tkgormImport = "github.com/infobloxopen/atlas-app-toolkit/v2/gorm" uuidImport = "github.com/satori/go.uuid" authImport = "github.com/infobloxopen/protoc-gen-gorm/auth"