PDA

View Full Version : ON UPDATE CASCADE option in a ENUM column


Nikos
01-18-2008, 02:55 AM
In MySQL does it ever make sense to have a ON UPDATE CASCADE option in a ENUM column.

This would be cool as If the column

`document_type` enum('publication','document') NOT NULL default 'document' ON UPDATE CASCADE


had 'publication' changed to 'paper' then all my inserts would be updated.

is this possible?

scoutt
01-20-2008, 05:40 PM
huh? when you update the record the value of the column will never change unless you change it. the enum('publication','document') means that is the only options it will except.

But to answer your question, This means that you cannot use self-referential ON UPDATE CASCADE or ON UPDATE SET NULL. This is to prevent infinite loops resulting from cascaded updates. Besides, it will onyl work on Innodb