[Vtigercrm-developers] [Vtigercrm-commits] [vtiger-commits] r4323 - /vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.php

Michel JACQUEMES m.jacquemes at neuf.fr
Mon Mar 20 10:09:18 PST 2006


Hi Mike,

I don't understand the purpose of this. As far as it is installation, it is
batch. So if there is a failure, simply drop the schema, create it and run
again. Use of transaction during this step is not very important. If it is
an upgrade, ask people to backup their base or do it by program.

On the other hand, if the target is to implement Mysql 5 or Postgres, they
support transactions. In that case I think something like :

$db->StartTrans();
... INSERT INTO $masterTable (id, field1,..) VALUES (DEFAULT,$val1,...)
$masterID = $db->Insert_ID();
... INSERT INTO $dependingTable (...,master_id,..) VALUES
(...,$masterID,...)
$ok = $db->CompleteTrans();

Is better

Michel

> -----Message d'origine-----
> De : vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-
> developers-bounces at lists.vtigercrm.com] De la part de Mike Fedyk
> Envoyé : lundi 20 mars 2006 16:07
> À : vtigercrm-developers at lists.vtigercrm.com; vtigercrm-
> commits at lists.vtigercrm.com
> Objet : Re: [Vtigercrm-developers] [Vtigercrm-commits] [vtiger-commits]
> r4323 -
> /vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.p
> hp
> 
> vtigercrm-commits at vtiger.fosslabs.com wrote:
> > Author: allanbush
> > Date: Mon Mar 20 03:04:56 2006
> > New Revision: 4323
> >
> > Log:
> > Added dummy sequence requests.
> >
> > Adodb usually creates sequences on demand, but if it trys to do it
> during a transaction problems can occur so we'll do them all right after
> the tables are created.  The side effect of this is that the first id in
> the tables will be 2 instead of 1.
> >
> > References ticket:17.
> >
> > Modified:
> >
> vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.ph
> p
> >
> > Modified:
> vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.ph
> p
> >
> ==========================================================================
> ====
> > ---
> vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.ph
> p (original)
> > +++
> vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.ph
> p Mon Mar 20 03:04:56 2006
> > @@ -227,6 +227,30 @@
> >  else
> >  	eecho("Tables Successfully created.\n");
> >
> > +// ensure required sequences are created (adodb creates them as needed,
> but if
> > +// creation occurs within a transaction we get problems
> > +$db->getUniqueID("activity_reminder");
> > +$db->getUniqueID("crmentity");
> > +$db->getUniqueID("customfield_sequence");
> > +$db->getUniqueID("customview");
> > +$db->getUniqueID("def_org_share");
> > +$db->getUniqueID("emailtemplates");
> > +$db->getUniqueID("field");
> > +$db->getUniqueID("import_maps");
> > +$db->getUniqueID("inventorynotification");
> > +$db->getUniqueID("mail_accounts");
> > +$db->getUniqueID("notificationscheduler");
> > +$db->getUniqueID("potstagehistory");
> > +$db->getUniqueID("profile");
> > +$db->getUniqueID("relatedlists");
> > +$db->getUniqueID("reportmodules");
> > +$db->getUniqueID("role");
> > +$db->getUniqueID("rss");
> > +$db->getUniqueID("selectquery");
> > +$db->getUniqueID("systems");
> > +$db->getUniqueID("wordtemplates");
> Any way this can be detected at runtime instead of storing a list of
> tables that need it in the source?
> _______________________________________________
> This vtiger.com email is sponsored by Zoho Planner. Still scribbling down
> your To-Do's on bits of paper & palms of your hands? Try the AJAX enabled,
> personal organizer online, Zoho Planner for FREE instead!
> http://zohoplanner.com/?vt





More information about the vtigercrm-developers mailing list