update_0801_0803.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * @version $Id: update_0801_0803.php 20129 2013-02-04 16:53:59Z moyo $
00005  -------------------------------------------------------------------------
00006  GLPI - Gestionnaire Libre de Parc Informatique
00007  Copyright (C) 2003-2013 by the INDEPNET Development Team.
00008 
00009  http://indepnet.net/   http://glpi-project.org
00010  -------------------------------------------------------------------------
00011 
00012  LICENSE
00013 
00014  This file is part of GLPI.
00015 
00016  GLPI is free software; you can redistribute it and/or modify
00017  it under the terms of the GNU General Public License as published by
00018  the Free Software Foundation; either version 2 of the License, or
00019  (at your option) any later version.
00020 
00021  GLPI is distributed in the hope that it will be useful,
00022  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024  GNU General Public License for more details.
00025 
00026  You should have received a copy of the GNU General Public License
00027  along with GLPI. If not, see <http://www.gnu.org/licenses/>.
00028  --------------------------------------------------------------------------
00029  */
00030 
00031 /** @file
00032 * @brief 
00033 */
00034 
00035 /**
00036  * Update from 0.80.1 to 0.80.3
00037  *
00038  * @return bool for success (will die for most error)
00039 **/
00040 function update0801to0803() {
00041    global $DB, $migration;
00042 
00043    $updateresult     = true;
00044    $ADDTODISPLAYPREF = array();
00045 
00046    //TRANS: %s is the number of new version
00047    $migration->displayTitle(sprintf(__('Update to %s'), '0.80.3'));
00048    $migration->setVersion('0.80.3');
00049 
00050    $migration->changeField("glpi_fieldunicities", 'fields', 'fields', "text");
00051 
00052    $migration->dropKey('glpi_ocslinks', 'unicity');
00053    $migration->migrationOneTable('glpi_ocslinks');
00054    $migration->addKey("glpi_ocslinks", array('ocsid', 'ocsservers_id'),
00055                         "unicity", "UNIQUE");
00056 
00057    // must always be at the end
00058    $migration->executeMigration();
00059 
00060    return $updateresult;
00061 }
00062 ?>