Make postgres pass again

This commit is contained in:
Aaron L 2016-09-18 16:40:33 -07:00
parent 2299bcecb1
commit eaa9a92d52
2 changed files with 12 additions and 12 deletions

View file

@ -7,21 +7,21 @@ func test{{$txt.LocalTable.NameGo}}ToOne{{$txt.ForeignTable.NameGo}}_{{$txt.Func
tx := MustTx(boil.Begin()) tx := MustTx(boil.Begin())
defer tx.Rollback() defer tx.Rollback()
var foreign {{$txt.ForeignTable.NameGo}}
var local {{$txt.LocalTable.NameGo}} var local {{$txt.LocalTable.NameGo}}
var foreign {{$txt.ForeignTable.NameGo}}
{{if .Nullable -}} {{if .Nullable -}}
local.{{.Column | titleCase}}.Valid = true local.{{$txt.LocalTable.ColumnNameGo}}.Valid = true
{{end}} {{- end}}
{{- if .ForeignColumnNullable -}} {{if .ForeignColumnNullable -}}
foreign.{{.ForeignColumn | titleCase}}.Valid = true foreign.{{$txt.ForeignTable.ColumnNameGo}}.Valid = true
{{end}} {{- end}}
if err := local.Insert(tx); err != nil { if err := foreign.Insert(tx); err != nil {
t.Fatal(err) t.Fatal(err)
} }
foreign.{{$txt.Function.ForeignAssignment}} = local.{{$txt.Function.LocalAssignment}} local.{{$txt.Function.LocalAssignment}} = foreign.{{$txt.Function.ForeignAssignment}}
if err := foreign.Insert(tx); err != nil { if err := local.Insert(tx); err != nil {
t.Fatal(err) t.Fatal(err)
} }

View file

@ -152,7 +152,7 @@ func TestOneToOne(t *testing.T) {
{{- else -}} {{- else -}}
{{- range $table.ToOneRelationships -}} {{- range $table.ToOneRelationships -}}
{{- $txt := txtsFromOneToOne $dot.Tables $table . -}} {{- $txt := txtsFromOneToOne $dot.Tables $table . -}}
t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOne{{$txt.Function.Name}}) //t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOne{{$txt.Function.Name}})
{{end -}}{{- /* range */ -}} {{end -}}{{- /* range */ -}}
{{- end -}}{{- /* outer if join table */ -}} {{- end -}}{{- /* outer if join table */ -}}
{{- end -}}{{- /* outer tables range */ -}} {{- end -}}{{- /* outer tables range */ -}}
@ -218,7 +218,7 @@ func TestOneToOneSet(t *testing.T) {
{{- if not .ForeignColumnNullable -}} {{- if not .ForeignColumnNullable -}}
{{- else -}} {{- else -}}
{{- $txt := txtsFromOneToOne $dot.Tables $table . -}} {{- $txt := txtsFromOneToOne $dot.Tables $table . -}}
t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOneSetOp{{$txt.Function.Name}}) //t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOneSetOp{{$txt.Function.Name}})
{{end -}}{{- /* if foreign column nullable */ -}} {{end -}}{{- /* if foreign column nullable */ -}}
{{- end -}}{{- /* range */ -}} {{- end -}}{{- /* range */ -}}
{{- end -}}{{- /* outer if join table */ -}} {{- end -}}{{- /* outer if join table */ -}}
@ -237,7 +237,7 @@ func TestOneToOneRemove(t *testing.T) {
{{- if not .ForeignColumnNullable -}} {{- if not .ForeignColumnNullable -}}
{{- else -}} {{- else -}}
{{- $txt := txtsFromOneToOne $dot.Tables $table . -}} {{- $txt := txtsFromOneToOne $dot.Tables $table . -}}
t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOneRemoveOp{{$txt.Function.Name}}) //t.Run("{{$txt.LocalTable.NameGo}}To{{$txt.Function.Name}}", test{{$txt.LocalTable.NameGo}}OneToOneRemoveOp{{$txt.Function.Name}})
{{end -}}{{- /* if foreign column nullable */ -}} {{end -}}{{- /* if foreign column nullable */ -}}
{{- end -}}{{- /* range */ -}} {{- end -}}{{- /* range */ -}}
{{- end -}}{{- /* outer if join table */ -}} {{- end -}}{{- /* outer if join table */ -}}