mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: support DESC indexes using atlasgo.io
This commit is contained in:
committed by
Ariel Mashraki
parent
94499bd141
commit
51663407cf
@@ -162,6 +162,14 @@ var (
|
||||
Unique: true,
|
||||
Columns: []*schema.Column{UsersColumns[7], UsersColumns[3]},
|
||||
},
|
||||
{
|
||||
Name: "user_age",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsersColumns[3]},
|
||||
Annotation: &entsql.IndexAnnotation{
|
||||
Desc: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
// FriendsColumns holds the columns for the "friends" table.
|
||||
|
||||
@@ -124,6 +124,8 @@ func (User) Indexes() []ent.Index {
|
||||
// and defining a new one.
|
||||
index.Fields("phone", "age").
|
||||
Unique(),
|
||||
index.Fields("age").
|
||||
Annotations(entsql.Desc()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user