Fields of the Project.
()
| 34 | |
| 35 | // Fields of the Project. |
| 36 | func (Project) Fields() []ent.Field { |
| 37 | return []ent.Field{ |
| 38 | field.UUID("id", uuid.UUID{}).Default(uuid.New).Unique(), |
| 39 | field.String("name").Immutable().Validate(biz.ValidateIsDNS1123), |
| 40 | field.String("description").Optional(), |
| 41 | field.Time("created_at"). |
| 42 | Default(time.Now). |
| 43 | Immutable(). |
| 44 | Annotations(&entsql.Annotation{ |
| 45 | Default: "CURRENT_TIMESTAMP", |
| 46 | }), |
| 47 | field.Time("updated_at"). |
| 48 | Default(time.Now). |
| 49 | Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), |
| 50 | field.Time("deleted_at").Optional(), |
| 51 | field.UUID("organization_id", uuid.UUID{}).Immutable(), |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // Edges of the Project. |
| 56 | func (Project) Edges() []ent.Edge { |