4036786b6a
* Split up insert function for testing * Add DBType to global state * Move test reflection helpers to testing.go * Add incremental seed to randomizeField to avoid duplicate constraint error messages * Fixed Viper SSL default bug * Fixed pgpass SSL inclusion bug * Add MakeStringMap strmangle helper * Change test errors from error to skip
27 lines
807 B
Smarty
27 lines
807 B
Smarty
{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
|
|
{{- $dbName := singular .Table.Name -}}
|
|
{{- $tableNamePlural := .Table.Name | plural | titleCase -}}
|
|
{{- $varNamePlural := .Table.Name | plural | camelCase -}}
|
|
{{- $varNameSingular := .Table.Name | singular | camelCase -}}
|
|
func {{$varNameSingular}}BeforeCreateHook(o *{{$tableNameSingular}}) error {
|
|
return nil
|
|
}
|
|
|
|
func {{$varNameSingular}}AfterCreateHook(o *{{$tableNameSingular}}) error {
|
|
return nil
|
|
}
|
|
|
|
func {{$varNameSingular}}BeforeUpdateHook(o *{{$tableNameSingular}}) error {
|
|
return nil
|
|
}
|
|
|
|
func {{$varNameSingular}}AfterUpdateHook(o *{{$tableNameSingular}}) error {
|
|
return nil
|
|
}
|
|
|
|
func Test{{$tableNamePlural}}Hooks(t *testing.T) {
|
|
// var err error
|
|
|
|
{{$varNamePlural}}DeleteAllRows(t)
|
|
t.Skip("Hook tests not implemented")
|
|
}
|