updated automigrate templates, added js bindings tests and updated models IsNew behavior

This commit is contained in:
Gani Georgiev
2022-12-05 13:57:09 +02:00
parent 604009bd10
commit b8cd686b32
21 changed files with 546 additions and 213 deletions
+8 -1
View File
@@ -195,7 +195,14 @@ func (s *Schema) UnmarshalJSON(data []byte) error {
s.AddField(f)
}
return s.InitFieldsOptions()
for _, field := range s.fields {
if err := field.InitOptions(); err != nil {
// ignore the error and remove the invalid field
s.RemoveField(field.Id)
}
}
return nil
}
// Value implements the [driver.Valuer] interface.