diff --git a/install/update_0901_0904.php b/install/update_0901_0904.php deleted file mode 100644 index a874075402a..00000000000 --- a/install/update_0901_0904.php +++ /dev/null @@ -1,102 +0,0 @@ -. - -------------------------------------------------------------------------- - */ - -/** @file -* @brief -*/ - -/** - * Update from 0.90.1 to 0.90.4 - * - * @return bool for success (will die for most error) -**/ -function update0901to0904() { - global $DB, $migration; - - $updateresult = true; - $ADDTODISPLAYPREF = array(); - - //TRANS: %s is the number of new version - $migration->displayTitle(sprintf(__('Update to %s'), '0.90.4')); - $migration->setVersion('0.90.4'); - - - $backup_tables = false; - $newtables = array(); - - foreach ($newtables as $new_table) { - // rename new tables if exists ? - if (TableExists($new_table)) { - $migration->dropTable("backup_$new_table"); - $migration->displayWarning("$new_table table already exists. ". - "A backup have been done to backup_$new_table."); - $backup_tables = true; - $query = $migration->renameTable("$new_table", "backup_$new_table"); - } - } - if ($backup_tables) { - $migration->displayWarning("You can delete backup tables if you have no need of them.", - true); - } - - // Add rights for licenses - $profileRight = new profileRight(); - foreach ($DB->request('glpi_profiles') as $profile) { - if (!countElementsInTable("glpi_profilerights", - "`profiles_id`='".$profile['id']."' AND `name`='license'")) { - $query = "SELECT `rights` - FROM `glpi_profilerights` - WHERE `profiles_id`='".$profile['id']."' - AND `name`='software'"; - $result = $DB->query($query); - $right = 0; - if ($DB->numrows($result) > 0) { - $right = $DB->result($result, 0, "rights"); - } - $query = "INSERT INTO `glpi_profilerights` - (`profiles_id`, `name`, `rights`) - VALUES ('".$profile['id']."', 'license', '$right')"; - } - } - - $migration->addField('glpi_softwarelicenses', 'is_template', 'bool'); - $migration->addField('glpi_softwarelicenses', 'template_name', 'string'); - $migration->addKey('glpi_softwarelicenses', 'is_template'); - - $migration->addField('glpi_softwarelicenses', 'is_deleted', 'bool'); - $migration->addKey('glpi_softwarelicenses', 'is_deleted'); - - // ************ Keep it at the end ************** - $migration->executeMigration(); - - return $updateresult; -}