索引
复合索引
package schema
import (
"github.com/facebookincubator/ent"
"github.com/facebookincubator/ent/schema/index"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
func (User) Indexes() []ent.Index {
return []ent.Index{
// non-unique index.
index.Fields("field1", "field2"),
// unique index.
index.Fields("first_name", "last_name").
Unique(),
}
}边的索引

支持的方言
Last updated
