You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a new record with the ORM, it doesn't respect the field defaults and puts NULL in instead. If a value isn't set in what's passed over to the save() method, the ORM shouldn't be setting it to NULL, it should be letting the table set what goes in the fields that were omitted.
The text was updated successfully, but these errors were encountered:
Actually that's not true, defaults should be set in the model because the model should always fully represent what's in the database. If you let your DB decide what to put in there the model wouldn't be complete after creation and you'd be working with potentially incorrect data. This is why the Orm\Model will never support DB defaults.
It's true however that the model doesn't yet support default values, that will probably be in for the 1.0 release though.
Okay, so at least I'm not going crazy. I tried throwing a default array item on some of the properties and it didn't do anything, so I just wanted to make sure it was reported so it could be fixed for 1.0. Thanks!
When you create a new record with the ORM, it doesn't respect the field defaults and puts NULL in instead. If a value isn't set in what's passed over to the
save()
method, the ORM shouldn't be setting it to NULL, it should be letting the table set what goes in the fields that were omitted.The text was updated successfully, but these errors were encountered: