<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Please add an issue on <a href="https://code.vtiger.com/vtiger/vtigercrm/-/issues">the tracker</a>.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jul 4, 2025 at 2:38 PM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">A customer just asked me about this...<br>
<br>
When they remove some records from the Recycle bin for a custom module, <br>
the entry in crmentity is removed, but the rows in the module's own <br>
tables are not deleted.<br>
<br>
Looking at the Module Model for the Recycle Bin I can see why:<br>
<br>
<a href="https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/pkg/vtiger/modules/RecycleBin/modules/RecycleBin/models/Module.php#L147" rel="noreferrer" target="_blank">https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/pkg/vtiger/modules/RecycleBin/modules/RecycleBin/models/Module.php#L147</a><br>
<br>
So my question is really about foreign key constraints.<br>
<br>
When we create a new module, should the vtlib code be adding a foreign <br>
key constraint and a on delete cascade?<br>
<br>
<a href="https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/vtlib/Vtiger/ModuleBasic.php?ref_type=heads#L294" rel="noreferrer" target="_blank">https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/vtlib/Vtiger/ModuleBasic.php?ref_type=heads#L294</a><br>
<br>
Thanks<br>
<br>
Al<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>