mirror of
https://github.com/rancher/norman.git
synced 2025-08-29 12:13:00 +00:00
Make ints not nullable by default
This commit is contained in:
parent
35fb4dfb92
commit
41c044bb25
@ -270,6 +270,11 @@ func (s *Schemas) readFields(schema *Schema, t reflect.Type) error {
|
|||||||
} else if fieldType.Kind() == reflect.Bool {
|
} else if fieldType.Kind() == reflect.Bool {
|
||||||
schemaField.Nullable = false
|
schemaField.Nullable = false
|
||||||
schemaField.Default = false
|
schemaField.Default = false
|
||||||
|
} else if fieldType.Kind() == reflect.Int ||
|
||||||
|
fieldType.Kind() == reflect.Int32 ||
|
||||||
|
fieldType.Kind() == reflect.Int64 {
|
||||||
|
schemaField.Nullable = false
|
||||||
|
schemaField.Default = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := applyTag(&field, &schemaField); err != nil {
|
if err := applyTag(&field, &schemaField); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user