dialect/sql/schema: allow setting table comments (#3365)

This commit is contained in:
Ariel Mashraki
2023-03-04 20:50:26 +02:00
committed by GitHub
parent f16451eab8
commit 3b7715b552
11 changed files with 55 additions and 9 deletions

View File

@@ -612,7 +612,8 @@ func (g *Graph) edgeSchemas() error {
func (g *Graph) Tables() (all []*schema.Table, err error) {
tables := make(map[string]*schema.Table)
for _, n := range g.Nodes {
table := schema.NewTable(n.Table())
table := schema.NewTable(n.Table()).
SetComment(n.sqlComment())
if n.HasOneFieldID() {
table.AddPrimary(n.ID.PK())
}