When a boolean/checkbox form field is not checked, I get a database constraint error on save: Integrity constraint violation: 1048 Column 'is_a_business' cannot be null
When I enable the typecasting observer and configure the column's $_properties to have 'data_type'=>'bool' and 'null'=>false, I get this error: Orm\InvalidContentType [ Error ]: The property "is_a_business" cannot be NULL.
I don't want to put in custom code for every single boolean/checkbox field in my app. What's a good way to solve this problem? I can just allow null in the database, but in my understanding that's less efficient? Maybe I'm over-optimizing again, though.
if it's not allowed to be null, you also have to define a 'default' value for the property, which the typing observer will assign if the value is null.