0
Answered

how to create ENUM in mysql

Markemark 10 years ago updated by Mariusz Zakrzewski 6 years ago 10
How can I create enumerated type.
For simplicity sake, say Male and Female

many thanks

Mark

Answer

Answer
Answered
Just insert your desired type into "Type" input. The selector (layer) with types contains only the most common datatypes. You can change it to whatever type you want. It looks like this:



This will rise a validation error saying that the type is not supported. This is our bug (not a critical one, I think). You can turn this validation off in "Model validation settings" which you can find in the menu on the top left, just below the Vertabelo logo. This validation rule is called "Supported database type (warnings)" in "Table column" section.
Answer
Answered
Just insert your desired type into "Type" input. The selector (layer) with types contains only the most common datatypes. You can change it to whatever type you want. It looks like this:



This will rise a validation error saying that the type is not supported. This is our bug (not a critical one, I think). You can turn this validation off in "Model validation settings" which you can find in the menu on the top left, just below the Vertabelo logo. This validation rule is called "Supported database type (warnings)" in "Table column" section.
thanks thats great, can you advise what the N checkbox means too, thanks
The "N" allows you to make the column nullable. By default, columns have "NOT NULL" constraint (since it's a good practice) and you can change it with this checkbox.
Seems to me a bit fundamental that Vetabelo cannot handle all the data types supported by the chosen database. Turning  "Supported database type (warnings)" off is not really a solution since that would then stop any real errors being flagged.

When will this bug be quashed?
Actually, it's not just fixing the bug that erroneously flags an ENUM field as not supported by MySQL, but rather that Vertabelo needs to actively support their use. IOW provide a suitable area to enter the options rather than having to stuff them in the column name field.

Same goes for SET data type. 
+1
Support for ENUM and SET is on the way. It should be available in the coming weeks.
+3

ENUM is still not available

That's what I love to hear :-)

Should we expect this feature any time soon?

Hi,

Currently, support for enum is not on our roadmap.