MySQL Workbench EER Diagram and ENUM data type

database-designdatabase-diagramsMySQLmysql-workbench

I am creating EER model diagram using MySQL Workbench (version : 5.2.47)

The version for MySQL, I am using is 5.5.35-0ubuntu0.13.10.2.

I have created a schema with 'Default Collation' set to 'utf8 – utf8_general_ci'.

I have created a table in EER diagram.

My basis goal is to add a column with ENUM data type.

But when I set the data type for my column to ENUM('A', 'B') and move ahead (by clicking enter key or tab key), the datatype for that column is replaced with last datatype (in my case VARCHAR(45) as its default for each column we create).

Can anybody help me to sort out this issue ?
Is there any issue in my configuration or method I am using ?

Best Answer

ENUM datatype was not supported in MySQL Workbench v5.x. I had the same problem with MWB v5.2. I just downloaded the latest 6.x (v6.1.4) and was able to create an ENUM which now appears in the Datatype dropdown menu of the table editor.

One word of caution regarding ENUMs, as noted in the MWB docs:

Caution: Care must be taken when entering a default value for ENUM columns because a non-numeric default will not be automatically quoted. You must manually add single quote characters for the default value. Note that MySQL Workbench will not prevent you from entering the default value without the single quotation marks. If a non-numeric default value is entered without quotation marks, this will lead to errors. For example, if the model is reverse engineered, the script will contain unquoted default values for ENUM columns and will fail if an attempt is made to run the script on MySQL Server.