Fix Location pointer
This commit is contained in:
parent
8f6191c4d2
commit
d56e28a36d
2 changed files with 4 additions and 22 deletions
|
@ -10,7 +10,7 @@ var (
|
||||||
currentDB Executor
|
currentDB Executor
|
||||||
// timestampLocation is the timezone used for the
|
// timestampLocation is the timezone used for the
|
||||||
// automated setting of created_at/updated_at columns
|
// automated setting of created_at/updated_at columns
|
||||||
timestampLocation *time.Location
|
timestampLocation = time.UTC
|
||||||
)
|
)
|
||||||
|
|
||||||
// DebugMode is a flag controlling whether generated sql statements and
|
// DebugMode is a flag controlling whether generated sql statements and
|
||||||
|
|
|
@ -2,13 +2,7 @@
|
||||||
{{- if not .NoAutoTimestamps -}}
|
{{- if not .NoAutoTimestamps -}}
|
||||||
{{- $colNames := .Table.Columns | columnNames -}}
|
{{- $colNames := .Table.Columns | columnNames -}}
|
||||||
{{if containsAny $colNames "created_at" "updated_at"}}
|
{{if containsAny $colNames "created_at" "updated_at"}}
|
||||||
loc := boil.GetLocation()
|
currTime := time.Now().In(boil.GetLocation())
|
||||||
currTime := time.Time{}
|
|
||||||
if loc != nil {
|
|
||||||
currTime = time.Now().In(boil.GetLocation())
|
|
||||||
} else {
|
|
||||||
currTime = time.Now()
|
|
||||||
}
|
|
||||||
{{range $ind, $col := .Table.Columns}}
|
{{range $ind, $col := .Table.Columns}}
|
||||||
{{- if eq $col.Name "created_at" -}}
|
{{- if eq $col.Name "created_at" -}}
|
||||||
{{- if $col.Nullable}}
|
{{- if $col.Nullable}}
|
||||||
|
@ -42,13 +36,7 @@
|
||||||
{{- if not .NoAutoTimestamps -}}
|
{{- if not .NoAutoTimestamps -}}
|
||||||
{{- $colNames := .Table.Columns | columnNames -}}
|
{{- $colNames := .Table.Columns | columnNames -}}
|
||||||
{{if containsAny $colNames "updated_at"}}
|
{{if containsAny $colNames "updated_at"}}
|
||||||
loc := boil.GetLocation()
|
currTime := time.Now().In(boil.GetLocation())
|
||||||
currTime := time.Time{}
|
|
||||||
if loc != nil {
|
|
||||||
currTime = time.Now().In(boil.GetLocation())
|
|
||||||
} else {
|
|
||||||
currTime = time.Now()
|
|
||||||
}
|
|
||||||
{{range $ind, $col := .Table.Columns}}
|
{{range $ind, $col := .Table.Columns}}
|
||||||
{{- if eq $col.Name "updated_at" -}}
|
{{- if eq $col.Name "updated_at" -}}
|
||||||
{{- if $col.Nullable}}
|
{{- if $col.Nullable}}
|
||||||
|
@ -66,13 +54,7 @@
|
||||||
{{- if not .NoAutoTimestamps -}}
|
{{- if not .NoAutoTimestamps -}}
|
||||||
{{- $colNames := .Table.Columns | columnNames -}}
|
{{- $colNames := .Table.Columns | columnNames -}}
|
||||||
{{if containsAny $colNames "created_at" "updated_at"}}
|
{{if containsAny $colNames "created_at" "updated_at"}}
|
||||||
loc := boil.GetLocation()
|
currTime := time.Now().In(boil.GetLocation())
|
||||||
currTime := time.Time{}
|
|
||||||
if loc != nil {
|
|
||||||
currTime = time.Now().In(boil.GetLocation())
|
|
||||||
} else {
|
|
||||||
currTime = time.Now()
|
|
||||||
}
|
|
||||||
{{range $ind, $col := .Table.Columns}}
|
{{range $ind, $col := .Table.Columns}}
|
||||||
{{- if eq $col.Name "created_at" -}}
|
{{- if eq $col.Name "created_at" -}}
|
||||||
{{- if $col.Nullable}}
|
{{- if $col.Nullable}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue