Skip to content

Commit b911b81

Browse files
committed
fix: add base field
1 parent b24cfed commit b911b81

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

api/gogen/ent/gen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func GenCRUDData(g *GenEntLogicContext, projectCtx *ctx.ProjectContext, schema *
323323
predicateData.WriteString(fmt.Sprintf("\tvar predicates []predicate.%s\n", schema.Name))
324324
count := 0
325325
for _, v := range schema.Fields {
326-
if v.Name == "id" || count >= g.SearchKeyNum {
326+
if v.Name == "id" || v.Name == "tenant_id" || count >= g.SearchKeyNum {
327327
continue
328328
}
329329

@@ -476,7 +476,7 @@ func GenApiData(schema *load.Schema, ctx GenEntLogicContext) (string, error) {
476476
}
477477

478478
for _, v := range schema.Fields {
479-
if v.Name == "id" {
479+
if v.Name == "id" || v.Name == "tenant_id" {
480480
continue
481481
}
482482

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var OldGoZeroVersion = []string{"v1.6.0", "v1.6.1", "v1.6.2", "v1.6.3", "v1.6.4"
1818
const DefaultToolVersion = "v1.8.2"
1919

2020
// GoctlsVersion is goctls version
21-
const GoctlsVersion = "v1.10.5"
21+
const GoctlsVersion = "v1.10.6"
2222

2323
// CoreVersion is the core service version.
2424
const CoreVersion = "v1.6.6"

rpc/generator/ent/gen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func GenCRUDData(g *GenEntLogicContext, projectCtx *ctx.ProjectContext, schema *
390390
predicateData.WriteString(fmt.Sprintf("\tvar predicates []predicate.%s\n", schema.Name))
391391
count := 0
392392
for _, v := range schema.Fields {
393-
if v.Name == "id" || count >= g.SearchKeyNum {
393+
if v.Name == "id" || v.Name == "tenant_id" || count >= g.SearchKeyNum {
394394
continue
395395
}
396396

@@ -621,7 +621,7 @@ func GenProtoData(schema *load.Schema, g GenEntLogicContext) (string, string, er
621621
index = 3
622622

623623
for _, v := range schema.Fields {
624-
if v.Name == "id" || count >= g.SearchKeyNum {
624+
if v.Name == "id" || v.Name == "tenant_id" || count >= g.SearchKeyNum {
625625
continue
626626
}
627627

util/entx/checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func IsUpperProperty(prop string) bool {
4646
// IsBaseProperty returns true when prop name is
4747
// id, created_at, updated_at, deleted_at
4848
func IsBaseProperty(prop string) bool {
49-
if prop == "id" || prop == "created_at" || prop == "updated_at" || prop == "deleted_at" {
49+
if prop == "id" || prop == "created_at" || prop == "updated_at" || prop == "deleted_at" || prop == "tenant_id" {
5050
return true
5151
}
5252
return false

0 commit comments

Comments
 (0)