InnoDB Cascade Rule that looks at 2 columns?
- by Travis
I have the following mysql InnoDB tables...
TABLE foldersA (
ID
title
)
TABLE foldersB (
ID
title
)
TABLE records (
ID
folderID
folderType
title
)
folderID in table "records" can point to ID in either "foldersA" or "foldersB" depending on the value of folderType. (0 or 1).
I am wondering:
Is there a way to create a CASCADE rule such that the appropriate rows in table records are automatically deleted when a row in either foldersA or folderB is deleted?
Or in this situation, am I forced to have to delete the rows in table "records" programatically?
Thanks for you help!