Book a Demo

Author Topic: MySQL ENUM type  (Read 4018 times)

mat127

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
MySQL ENUM type
« on: March 21, 2006, 01:28:07 am »
Hello,

I have found that MySQL ENUM type is supported within the data modeling since EA 4.50 Build 740 according to ea_history.html:

Added support for MySQL ENUM and SET datatypes for generating DDL.

Unfortunately I am not able to find a way how to create ENUM column in a table. The default set of MySQL column types does not contain ENUM type. So I had to add it using the Database Datatypes dialog. After doing this I could select the ENUM type for a column in the column properties dialog, but I do not know how to define possible ENUM values.

With a "plain" ENUM definition EA generates DDL in the form:

CREATE TABLE sometable (
...
some_column ENUM NOT NULL,
...
) ;

But I would like to get something like:

CREATE TABLE sometable (
...
some_column ENUM('val1', 'val2', ...,'valN') NOT NULL,
...
) ;

Any suggestions? I am using EA 6.1.788 on the Linux OS.

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: MySQL ENUM type
« Reply #1 on: March 21, 2006, 01:27:07 pm »
Add the ENUM datatype.

Create a column with the ENUM datatype.

Add the values in the Initial: field for that column...  eg. 'A','B','C'

Generate the DDL.