Schema manager & nullable columns


Well-known member
When using the schema manager calling setDefault(null) on a column does not make a column nullable.

I don't feel it makes much sense that if there is an explicit call to set the default as nullable, the column stays non-nullable

Chris D

XenForo developer
Staff member
Although perhaps not an unreasonable suggestion, would it not be clearer and shorter to just forget setting a default value, and just set nullable yourself? If no other default value is set, the default value is set to NULL for a nullable column in the Schema Manager.


Well-known member
I'm ok with that, but in that case shouldn't setDefault(null) on a non-nullable column throw a logic exception?

Sure, the schema manager silently ignores it; but being explicit about your SQL schema types is good.