[Vtigercrm-developers] vtlib module migration advice
stprasad at stprasad.com
stprasad at stprasad.com
Tue Oct 1 13:43:35 UTC 2013
Hi Alan,
I would go with post update, as the housekeeping would be done.
Also, on another note, there is a post install, I long for a pre install in some situations, but have made do with code at the start of post install.
HTH,
Regards, ST Prasad
Sent from BlackBerry® on Airtel
-----Original Message-----
From: Alan Lord <alanslists at gmail.com>
Sender: vtigercrm-developers-bounces at lists.vtigercrm.comDate: Tue, 01 Oct 2013 14:32:49
To: <vtigercrm-developers at lists.vtigercrm.com>
Reply-To: vtigercrm-developers at lists.vtigercrm.com
Subject: [Vtigercrm-developers] vtlib module migration advice
I've discovered a bit of a bug with the GeoTools module whereby the
Primary index on the main table is not specific enough (spans three
columns) which might result in duplicate entries in the vtiger_geotools
table.
I can't write destructive SQL in the manifest.xml file so am assuming I
will need to write a function in the module class triggered by either
the "module.preupdate" or "module.postupdate" methods.
My question is which one of the two methods would be best to trigger my
database change function?
Basically I need to do something like this:
> CREATE TABLE `temp_table` AS SELECT * FROM `vtiger_geotools` WHERE 1 GROUP BY geotoolsid;
> DROP TABLE `vtiger_geotools`;
> RENAME TABLE `temp_table` TO `vtiger_geotools`;
> ALTER TABLE `vtiger_geotools` DROP PRIMARY KEY;
> ALTER TABLE `vtiger_geotools` ADD PRIMARY KEY (`geotoolsid`);
Or does it not make much difference? I'm inclined to choose the
postupdate personally.
Cheers
Al
_______________________________________________
http://www.vtiger.com/
More information about the vtigercrm-developers
mailing list