When I insert a blank form into a table that has columns defined as default null, Yii seems to replace those null values with an empty string. This can create problems with my data as I’ll often search for IS NULL or NOT NULL, and empty string will appear as NOT NULL in those queries.
I’ve gotten around this by setting a “default” validator for the fields in question to null, but I’m wondering if there’s a way to get Yii to do this automatically.
In other words - should Yii’s default behavior be - when inserting or updating a blank text field into a column that contains NULL and also has a default value of NULL - keep it null, don’t replace it with an empty string?
Hoping to start a discussion of the pros and cons of doing this, and whether there’s a way to have it happen automatically in Yii.