mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc: improve generated comments for edges and fields (#2632)
* replace default field comment with user comment if defined * use comments defined on edges in generated entities * add docs for comment method on edges and fields * update integration to reflect above changes
This commit is contained in:
@@ -73,6 +73,7 @@ type Edge struct {
|
||||
Required bool `json:"required,omitempty"`
|
||||
StorageKey *edge.StorageKey `json:"storage_key,omitempty"`
|
||||
Annotations map[string]interface{} `json:"annotations,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
}
|
||||
|
||||
// Index represents an ent.Index that was loaded from a complied user package.
|
||||
@@ -97,6 +98,7 @@ func NewEdge(ed *edge.Descriptor) *Edge {
|
||||
RefName: ed.RefName,
|
||||
Through: ed.Through,
|
||||
StorageKey: ed.StorageKey,
|
||||
Comment: ed.Comment,
|
||||
Annotations: make(map[string]interface{}),
|
||||
}
|
||||
for _, at := range ed.Annotations {
|
||||
|
||||
Reference in New Issue
Block a user