Skip to content

Commit

Permalink
fix model saveAll method
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 12, 2021
1 parent 7db2a86 commit 9f0b143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/xservice/model/mysql/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (t *MySQLGenerator) tableDefaultModel(table *Table) *jen.Statement {
// SaveAll
c.Comment("SaveAll update all items in database, if the value doesn't have primary key, will insert it").Line()
c.Func().Params(jen.Id("t").Op("*").Id(typeName)).Id("SaveAll").Params(jen.Id("data []*").Id(modelName)).Id("error").Block(
jen.Return(jen.Id("t.tx.Create(data).Error")),
jen.Return(jen.Id("t.tx.Save(data).Error")),
).Line()

// Update
Expand Down

0 comments on commit 9f0b143

Please sign in to comment.