Q:

Disable Integrity constraint violation: 1048

I have a table which has a column configured as NOT NULL.
I would like to insert a record with a NULL value for that column.
How do I temporarily disable this check?  I am thinking something like SET foreign_key_checks = 0;, but not for foreign key checks but NOT NULL checks.

A:

A column constraint is not a foreign key. You can't disable column constraints.
If the value must not be NULL, it's been set to that for a reason.
If you were able to disable it and re-enable it after adding a NULL value, it would still be invalid for the column.
Either change the column settings to allow NULL or insert an empty value instead (UPDATE table SET column = '';).
Keep your schema valid and normalized!

