MySQL Forums
Forum List  »  Newbie

Re: using enum versus tiny int and lookup table
Posted by: Huu Da Tran
Date: April 16, 2008 06:04PM

To me, using enum() only if you are absolutely sure that your value set will not change, otherwise, you would need to alter table.

Adding possible values is easy. When it comes to delete possible values, with a lookup with FK, you can easily drop all unwanted values. If you do that with enum(), all values might point to the wrong "word" (unless you manually clean before your alter).


One time, I got caught with finite values in an enum, that by some magic requests from upper levels, wanted the values to be i18n... so I had to change to a lookup table. And that was as "stupid" as Canada provinces' names.

So, as said before, judgement call.

Options: ReplyQuote


Subject
Written By
Posted
Re: using enum versus tiny int and lookup table
April 16, 2008 06:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.