never update created_at, updated_at columns
This commit is contained in:
parent
77fc991e7b
commit
396f42bc91
1 changed files with 1 additions and 3 deletions
|
@ -56,11 +56,9 @@ func (o *{{$tableNameSingular}}) Update(exec boil.Executor, whitelist ... string
|
||||||
{{if eq .DriverName "mssql"}}
|
{{if eq .DriverName "mssql"}}
|
||||||
wl = strmangle.SetComplement(wl, {{$varNameSingular}}ColumnsWithAuto)
|
wl = strmangle.SetComplement(wl, {{$varNameSingular}}ColumnsWithAuto)
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if not .NoAutoTimestamps}}
|
|
||||||
if len(whitelist) == 0 {
|
if len(whitelist) == 0 {
|
||||||
wl = strmangle.SetComplement(wl, []string{"created_at"})
|
wl = strmangle.SetComplement(wl, []string{"created_at","updated_at"})
|
||||||
}
|
}
|
||||||
{{end -}}
|
|
||||||
if len(wl) == 0 {
|
if len(wl) == 0 {
|
||||||
return errors.Err("{{.PkgName}}: unable to update {{.Table.Name}}, could not build whitelist")
|
return errors.Err("{{.PkgName}}: unable to update {{.Table.Name}}, could not build whitelist")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue