Преглед на файлове

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 {