From edf678b47db9ad6466f5ac066e15620f5ae05686 Mon Sep 17 00:00:00 2001 From: Hironao OTSUBO Date: Wed, 22 Nov 2023 14:15:14 +0900 Subject: [PATCH] use aliased field name for lastID --- templates/main/15_insert.go.tpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/main/15_insert.go.tpl b/templates/main/15_insert.go.tpl index 6823fff5a..0e1c6c273 100644 --- a/templates/main/15_insert.go.tpl +++ b/templates/main/15_insert.go.tpl @@ -152,8 +152,7 @@ func (o *{{$alias.UpSingular}}) Insert({{if .NoContext}}exec boil.Executor{{else {{$colName := index .Table.PKey.Columns 0 -}} {{- $col := .Table.GetColumn $colName -}} - {{- $colTitled := $colName | titleCase}} - o.{{$colTitled}} = {{$col.Type}}(lastID) + o.{{$alias.Column $colName}} = {{$col.Type}}(lastID) if lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == {{$alias.DownSingular}}Mapping["{{$colName}}"] { goto CacheNoHooks }