How to delete a polymorphic row when deleting a model? #14411
-
Hello guys, I have a Category model that has a polymorphic table called "categorizables" I have model called |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If I'm not mistaken, a polymorphic row is a row that can reference different tables? You need to delete it manually |
Beta Was this translation helpful? Give feedback.
If I'm not mistaken, a polymorphic row is a row that can reference different tables?
If that's the case, that is not supported, as we rely on
ON DELETE CASCADE
to delete the row from the through table, and such a row would not have a foreign key.You need to delete it manually