Reputation: 6085
I have added a new enum column, enum('true','false') in an existing MySQL table. What I am getting is whole table default enum field 'true' as default value. I haven't set anything default, why is this happening?
Upvotes: 3
Views: 273
Reputation: 28174
From the MySQL manual:
If an ENUM column is declared to permit NULL, the NULL value is a legal value for the column, and the default value is NULL. If an ENUM column is declared NOT NULL, its default value is the first element of the list of permitted values.
Upvotes: 2