Skip to content

Commit 216801b

Browse files
committed
Simplify output sql format
1 parent da34e91 commit 216801b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/formatter/formatter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
)
99

1010
const (
11-
baseSql = "ALTER TABLE %s ADD CONSTRAINT %s_ibfk_%s%s FOREIGN KEY (%s) REFERENCES %s(%s);"
11+
baseSql = "ALTER TABLE %s ADD CONSTRAINT FOREIGN KEY (%s) REFERENCES %s(%s);"
1212
)
1313

1414
func FormatSql(constraints []constraint.Constraint) string {
1515
var queries []string
1616

1717
for _, c := range constraints {
18-
q := fmt.Sprintf(baseSql, c.Table, c.Table, c.ReferedTable, c.ReferedColumn, c.Column, c.ReferedTable, c.ReferedColumn)
18+
q := fmt.Sprintf(baseSql, c.Table, c.Column, c.ReferedTable, c.ReferedColumn)
1919
queries = append(queries, q)
2020
}
2121

0 commit comments

Comments
 (0)