mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
entc/load: merge annotations from the same type
This commit is contained in:
committed by
Ariel Mashraki
parent
ad01a0aadb
commit
be9955a860
@@ -58,7 +58,7 @@ func (Annotation) Name() string {
|
||||
}
|
||||
|
||||
// Merge implements the schema.Merger interface.
|
||||
func (a *Annotation) Merge(other schema.Annotation) {
|
||||
func (a Annotation) Merge(other schema.Annotation) schema.Annotation {
|
||||
var ant Annotation
|
||||
switch other := other.(type) {
|
||||
case Annotation:
|
||||
@@ -68,7 +68,7 @@ func (a *Annotation) Merge(other schema.Annotation) {
|
||||
ant = *other
|
||||
}
|
||||
default:
|
||||
return
|
||||
return a
|
||||
}
|
||||
if t := ant.Table; t != "" {
|
||||
a.Table = t
|
||||
@@ -85,6 +85,7 @@ func (a *Annotation) Merge(other schema.Annotation) {
|
||||
if s := ant.Size; s != 0 {
|
||||
a.Size = s
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user