Open GoogleCodeExporter opened 9 years ago
Now this could easily be avoided if you just enter a default value by hand
before clicking in the next row.
But yes, I think if Allow NULL is not selected and Default is empty for an ENUM
field we should probably stick the first value of the ENUM there.
Original comment by schlabbe...@gmail.com
on 26 Jun 2012 at 6:11
Please adjust the priority of this issue. If this is required value, we
shouldnt be auto populating an empty string.
For example this is perfectly valid
ALTER TABLE stock_history ADD record_type ENUM('delivery', 'stock_take') NOT
NULL
which forces the insert query to specify a value. There should be no reason to
require a default value. This makes it impossible to make such changes via the
normal GUI, instead forcing me to make changes via manual ALTER statements.
Original comment by da...@temperedvision.com
on 30 Jul 2012 at 9:42
The example you show can be done by unchecking "Allow Null" and then entering
"NULL" in the "Default" column.
This is a bit counter-intuitive but at least there is a way to accomplish this
via GUI.
Original comment by schlabbe...@gmail.com
on 30 Jul 2012 at 7:11
If you don't want to allow nulls then the workaround mentioned is a no-go.
Original comment by jhalter...@gmail.com
on 14 Dec 2012 at 9:20
I've run into this issue too--I have a table with a field with type enum, Null
is not allowed, and no default is set. I tried to edit the field to add an
additional enum value, and it tried to set the default to '', rather than
setting no default.
i.e., the query was:
ALTER TABLE `tablename` CHANGE `fieldname` `fieldname` ENUM('foo','bar','baz')
CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
Where I wanted:
ALTER TABLE `tablename` CHANGE `fieldname` `fieldname` ENUM('foo','bar','baz')
CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
Original comment by danielk...@gmail.com
on 6 Feb 2013 at 4:54
Happy user, Just wanting to chime in that this issue recently bit me as well. I
discovered the rather yucky workaround described three comments ago, but it
took a while to figure out, and it feels like a real hassle.
My recommendation would involve having the GUI interpret "Allow Null" being
unchecked and "Default" being blank such that a "DEFAULT" clause isn't included
in the generated table-creation SQL at all.
Original comment by j...@appleseed-sc.com
on 9 Nov 2013 at 12:40
Original issue reported on code.google.com by
xch...@bbtv.com
on 25 Jun 2012 at 11:35