entc/gen: add support for referencing fks to existing fields (#1289)

This commit is contained in:
Ariel Mashraki
2021-03-01 22:57:32 +02:00
committed by GitHub
parent 31bee10942
commit 0d0a93b95f
90 changed files with 6936 additions and 327 deletions

View File

@@ -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