[Vtigercrm-developers] Delete records from recycle bin

Prasad prasad at vtiger.com
Wed Jul 23 04:10:01 GMT 2025


MyISAM <https://dev.mysql.com/doc/refman/8.4/en/optimizing-myisam.html>
compatibility
was an earlier reason why FK constraints were not applied.
Now that InnoDB is default and preferred we could enforce it.

For migration we have to clear the orphan records and then enable
constraints.
For reference field relation ON DELETE SET NULL might be required.

Added notes to issue.

On Fri, Jul 4, 2025 at 6:20 PM Alan Lord <alanslists at gmail.com> wrote:

> Done: https://code.vtiger.com/vtiger/vtigercrm/-/issues/1983
>
> Al
>
> On 04/07/2025 11:52, Prasad wrote:
> > Please add an issue on the tracker
> > <https://code.vtiger.com/vtiger/vtigercrm/-/issues>.
> >
> > On Fri, Jul 4, 2025 at 2:38 PM Alan Lord
> > <alanslists at gmail.com
> > <mailto:alanslists at gmail.com>> wrote:
> >
> >     A customer just asked me about this...
> >
> >     When they remove some records from the Recycle bin for a custom
> module,
> >     the entry in crmentity is removed, but the rows in the module's own
> >     tables are not deleted.
> >
> >     Looking at the Module Model for the Recycle Bin I can see why:
> >
> >
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/pkg/vtiger/modules/RecycleBin/modules/RecycleBin/models/Module.php#L147
> <
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/pkg/vtiger/modules/RecycleBin/modules/RecycleBin/models/Module.php#L147
> >
> >
> >     So my question is really about foreign key constraints.
> >
> >     When we create a new module, should the vtlib code be adding a
> foreign
> >     key constraint and a on delete cascade?
> >
> >
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/vtlib/Vtiger/ModuleBasic.php?ref_type=heads#L294
> <
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/vtlib/Vtiger/ModuleBasic.php?ref_type=heads#L294
> >
> >
> >     Thanks
> >
> >     Al
> >
> >     _______________________________________________
> >     http://www.vtiger.com/ <http://www.vtiger.com/>
> >
> >
> > _______________________________________________
> > http://www.vtiger.com/
>
>
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250723/05c3fae3/attachment.html>


More information about the vtigercrm-developers mailing list