Skip to content

Commit 950ebd7

Browse files
committed
Fix using boolean fields in condition indexes
1 parent 2bb6fd3 commit 950ebd7

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

internal/pkg/backend/postgres/tmpl/pkg/index.tmpl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,16 @@ var index{{ $ind.Name }} = postgres.Index{
154154
{{ if not $c.IsNullCheck -}}
155155
Values: []any{
156156
{{ range $_, $v := $c.Value }}
157-
{{ $packerparam := packerParam $ifield.Format -}}
158-
{{ $des := $packerparam.StringDeserializer }}
159-
{{ if ne (len $des) 0 }}
160-
{{ index $des 0 }}"{{ $v }}"{{ index $des 1 }},
161-
{{ else if eq $ifield.Format "bool" }}
157+
{{ if eq $ifield.Format "bool" }}
162158
{{ $v }},
163159
{{ else }}
164-
"{{ $v }}",
160+
{{ $packerparam := packerParam $ifield.Format -}}
161+
{{ $des := $packerparam.StringDeserializer }}
162+
{{ if ne (len $des) 0 }}
163+
{{ index $des 0 }}"{{ $v }}"{{ index $des 1 }},
164+
{{ else }}
165+
"{{ $v }}",
166+
{{ end }}
165167
{{ end }}
166168
{{ end }}
167169
},

0 commit comments

Comments
 (0)