<p><a href="https://github.com/abraxxa" class="user-mention">@abraxxa</a> you are right, I was forgetting about deploy.</p>

<p>So, how about a new attribute <code>cascade_delete_before</code></p>

<p>If it does not exist, or is undefined, then things stay as they are. If it defined then the cascade code would be run before the delete of the main row, but only if it is true.</p>

<p>So cascade_delete=1 and cascade_delete_before=0 would depend completely on the RDBMS doing the cascade and cascade_delete=1 and cascade_delete_before=1 would delete the relationships before deleting the row</p>

<p>With this existing code would be completely unaffected and the new attribute will control where and if the code attempts the cascade the delete</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/dbsrgits/dbix-class/pull/27#issuecomment-18347594'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/4W3BWTo7EIi_7vx28Xzl_mJnCwjxj52C33_Ervpy2ogo-MvpszQvTwkKiTOIEY0G.gif' height='1' width='1'></p>