php - Delete polymorphic relation table automatically -


i have comments table can have 2 kinds of author, registered 1 , guest.

to handle that, made polymorphic relation between comments, user_registered, , guest table

when delete spesific post in posts table, comments have foreign key deleted problem guest , user_registered table have polymorphic relation comments table not automatically deleted.

so question is, can polymorphic relation table deleted automatically when main table deleted. foreign key behaviour (delete cascade)

thx guys..

you can use model events process relationships upon events such deleting.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -