From 396f42bc91eec4d95f3dc1c5180a863175824033 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Mon, 16 Apr 2018 12:41:55 -0400 Subject: [PATCH] never update created_at, updated_at columns --- templates/16_update.tpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/16_update.tpl b/templates/16_update.tpl index eee2036..a4a688c 100644 --- a/templates/16_update.tpl +++ b/templates/16_update.tpl @@ -56,11 +56,9 @@ func (o *{{$tableNameSingular}}) Update(exec boil.Executor, whitelist ... string {{if eq .DriverName "mssql"}} wl = strmangle.SetComplement(wl, {{$varNameSingular}}ColumnsWithAuto) {{end}} - {{if not .NoAutoTimestamps}} 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 { return errors.Err("{{.PkgName}}: unable to update {{.Table.Name}}, could not build whitelist") }