mirror of
https://github.com/ent/ent.git
synced 2026-03-05 19:35:23 +03:00
schema/field: allow setting time fields as unique (#4220)
* schema/field: allow setting time fields as unique * .github: goodbye crate-ci/typos
This commit is contained in:
@@ -477,6 +477,12 @@ func (b *timeBuilder) Deprecated(reason ...string) *timeBuilder {
|
||||
return b
|
||||
}
|
||||
|
||||
// Unique makes the field unique within all vertices of this type.
|
||||
func (b *timeBuilder) Unique() *timeBuilder {
|
||||
b.desc.Unique = true
|
||||
return b
|
||||
}
|
||||
|
||||
// Descriptor implements the ent.Field interface by returning its descriptor.
|
||||
func (b *timeBuilder) Descriptor() *Descriptor {
|
||||
if b.desc.Default != nil {
|
||||
|
||||
Reference in New Issue
Block a user