| 31 | } |
| 32 | |
| 33 | func (Referrer) Fields() []ent.Field { |
| 34 | return []ent.Field{ |
| 35 | field.UUID("id", uuid.UUID{}).Default(uuid.New).Unique(), |
| 36 | field.String("digest").Immutable(), |
| 37 | // referrer kind i.e CONTAINER |
| 38 | field.String("kind").Immutable(), |
| 39 | // wether it can be downloaded from CAS or not |
| 40 | field.Bool("downloadable").Immutable(), |
| 41 | field.Time("created_at"). |
| 42 | Default(time.Now). |
| 43 | Immutable(). |
| 44 | Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), |
| 45 | field.JSON("metadata", map[string]string{}).Optional().Immutable(), |
| 46 | field.JSON("annotations", map[string]string{}).Optional().Immutable(), |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func (Referrer) Edges() []ent.Edge { |
| 51 | return []ent.Edge{ |