tags:

views:

20

answers:

1

I have an application that works with database (PHP + MySQL).

One of the columns in the database table is of type ENUM('VALUE1','VALUE2').

Is that possible to add safely VALUE3 to the ENUM without damaging the data in the table ?

+2  A: 

if you add to the end is seem safe , see the manual

For some operations, a “fast” ALTER TABLE is possible that does not require a temporary table: .... Changing the definition of an ENUM or SET column by adding new enumeration or set members to the end of the list of valid member values. (Adding members in the middle of the list causes renumbering of existing members, which requires a table copy.)

read in :

http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

also good point look in the article:

http://www.brandonsavage.net/why-you-should-replace-enum-with-something-else/

Haim Evgi
Thanks for the links. The second link is great!
Misha Moroshko