| [ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
| Poids: | 900 lignes (31 kb) |
| Inclus ou requis: | 0 fois |
| Référencé: | 0 fois |
| Nécessite: | 0 fichiers |
| addressbook_upgrade0_9_3pre10() X-Ref |
| Pas de description |
| may(But, there may be values in this array you would want touse within the function. More on that later.There is one other variable you would need if doing any databaseoperations here. If you global $phpgw_setup, you will thenhave access to db and schema_proc objects and functions.The objects of interest here are:* $phpgw_setup->oProc* $phpgw_setup->db.For most database work you should use the oProc object. Thisalso has a db object that should be used for most standardphpgw API db class functions, including $db->query, next_record,num_rows, and f. The use of these for standard db operationsis critical to the upgrade process. Schema_proc has a flagthat can be set to determine what mode of upgrade we arein. This flag is set in the setup class during the upgradeprocess, and should not be altered locally.This flag is a decision on whether to alter the databaseor the schema_proc array. The tables_baseline file aboveis loaded by setup prior to running your upgrade routines.If the current installed version is greater than the currentupgrade routine, we don't need to alter the database yet.But schema_proc instead alters the $phpgw_baseline arrayin memory. The maintenance of this array is done even whenwe do alter the database. Once our version number in thetest array matches the currently installed version of anapplication, real work on the tables begins.'Why bother modifying this array at all', you may ask. Thearray must be maintained in order to keep current tabledefinition status. This is used in some schema_proc functionswhen altering columns and tables. This is especially criticalfor pgsql schema_proc functions.By using the $phpgw_setup->oProc object for basic insertsand queries, we acheive the ability to run all upgrade functionsin every upgrade cycle without actually altering the databaseuntil we reach the current version we actually want to upgrade.For example:$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='notes'";$phpgw_setup->oProc->query($sql,__LINE__,__FILE__) X-Ref |
| Pas de description |
| DropTable($sTableName) X-Ref |
| Pas de description |
| DropColumn($sTableName, $aTableDef, $sColumnName) X-Ref |
| Pas de description |
| RenameTable($sOldTableName, $sNewTableName) X-Ref |
| Pas de description |
| RenameColumn($sTableName, $sOldColumnName, $sNewColumnName) X-Ref |
| Pas de description |
| AlterColumn($sTableName, $sColumnName, $aColumnDef) X-Ref |
| Pas de description |
| AddColumn($sTableName, $sColumnName, $aColumnDef) X-Ref |
| Pas de description |
| CreateTable($sTableName, $aTableDef) X-Ref |
| Pas de description |
| Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |