<div dir="auto"> Correct, but i fetched this queries from a latest version db dump, comes usually at the bottom, and ran it in the upgraded version's db. Then purged crmentity.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 1, 2019, 6:43 PM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/07/2019 13:32, Sutharsan J wrote:<br>
> HI<br>
> <br>
> If your database has proper foreign key constraints, it will remove all <br>
> entity data when you clear vtiger_crmentity table (i.e flush recycle <br>
> bin). Eg, For accounts<br>
> <br>
> ALTER TABLE `vtiger_account`<br>
>    ADD CONSTRAINT `fk_1_vtiger_account` FOREIGN KEY (`accountid`) <br>
> REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;<br>
<br>
This is correct but these were only added relatively recently to the <br>
migration scripts. If you are upgrading and you have inconsistent row <br>
ids between any of the tables these constraints fail.<br>
<br>
<br>
<a href="http://code.vtiger.com/vtiger/vtigercrm/issues/1073" rel="noreferrer noreferrer" target="_blank">http://code.vtiger.com/vtiger/vtigercrm/issues/1073</a><br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>