is it possible to create a enum field?
we are planning to import an existing database including several enum fileds for use in a drupal enviroment. sadly there seems to be no data type "enum" available in drupal 6.4. is there a convenient option to add such a data type? has anybody had the sane problem and an acceptable solution or workaround?

thanks a lot,

Comments

Setzler’s picture

Drupal's schema API is (shockingly) lacking. The best I have seen recommended is to do something like this:

 DEFINE('FIELD_VALUEDEFAULT', 0);
DEFINE('FIELD_VALUE1', 1);
DEFINE('FIELD_VALUE2', 2); 

Then use a tinyint field type and the defined constants.

Do you think it's possible that the API is lacking to due any insurmountable differences between database brands?