My requirement
The table should contain a status column.
This column represents one of 5 states.
initial design
I decided that I could just make it an entire column and represent the states using a numerical value.
- 0 = start
- 1 = start
- 2 = crashed
- 3 = paused
- 4 = stopped
Since I do not want my application to support matching of integers with their string description, I plan to put them in a separate state description table (relying on the FK relation).
Then I discovered that MySQL has an ENUM type that exactly matches my requirements. Besides the direct dependency on MySQL, are there any pitfalls using the ENUM type?
enums mysql database-design
ashitaka Dec 12 '08 at 6:34 2008-12-12 06:34
source share