Skip to content

Commit 86d7786

Browse files
author
Takeshi Nakata
authored
Merge pull request #5 from s13o/master
Diagramm is not created when FK has no name #2
2 parents 33a2ada + 421b305 commit 86d7786

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
testdata/spanner_er.png
2+
.idea

graph.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ func (g *Graph) AddTables(groupSize int, tables []*spansql.CreateTable) error {
121121
}
122122
for _, c := range t.Constraints {
123123
opt := make(map[string]string)
124-
opt["label"] = c.Name
124+
if c.Name != "" {
125+
opt["label"] = c.Name
126+
}
125127
if err := g.AddForeignKeyEdge(c.ForeignKey.RefTable, t.Name, opt); err != nil {
126128
return err
127129
}

0 commit comments

Comments
 (0)