فهرست منبع

fix:代码里表结构增加索引

jimmyyem 8 ماه پیش
والد
کامیت
b842e812e5
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      ent/schema/agent.go

+ 4 - 1
ent/schema/agent.go

@@ -1,6 +1,7 @@
 package schema
 
 import (
+	"entgo.io/ent/schema/index"
 	"wechat-api/ent/schema/localmixin"
 
 	"entgo.io/ent"
@@ -37,7 +38,9 @@ func (Agent) Edges() []ent.Edge {
 }
 
 func (Agent) Indexes() []ent.Index {
-	return []ent.Index{}
+	return []ent.Index{
+		index.Fields("organization_id"),
+	}
 }
 
 func (Agent) Annotations() []schema.Annotation {