mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen: add support for referencing fks to existing fields (#1289)
This commit is contained in:
@@ -66,6 +66,12 @@ func (t *Table) AddColumn(c *Column) *Table {
|
||||
return t
|
||||
}
|
||||
|
||||
// HasColumn reports if the table contains a column with the given name.
|
||||
func (t *Table) HasColumn(name string) bool {
|
||||
_, ok := t.columns[name]
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetAnnotation the entsql.Annotation on the table.
|
||||
func (t *Table) SetAnnotation(ant *entsql.Annotation) *Table {
|
||||
t.Annotation = ant
|
||||
|
||||
Reference in New Issue
Block a user