Skip to content

Commit

Permalink
fix(generate): created/updated_at without default (#359)
Browse files Browse the repository at this point in the history
* fix(generate): created/updated/deleted_at without default

* feat(generate): remove verbose judge
  • Loading branch information
tr1v3r authored Jan 18, 2022
1 parent bb8de83 commit a4fdb0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/model/tbl_column.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func (c *Column) buildGormTag() string {
buf.WriteString(fmt.Sprintf(";index:%s,priority:%d", idx.IndexName, idx.SeqInIndex))
}
}
if c.ColumnDefault != "" {
if c.ColumnDefault != "" &&
c.ColumnName != "created_at" && c.ColumnName != "updated_at" {
buf.WriteString(fmt.Sprintf(";default:%s", c.ColumnDefault))
}
return buf.String()
Expand Down

0 comments on commit a4fdb0d

Please sign in to comment.