diff --git a/install/upgrade_to_2.10.php b/install/upgrade_to_2.10.php index aaede1265..e914adc00 100644 --- a/install/upgrade_to_2.10.php +++ b/install/upgrade_to_2.10.php @@ -29,6 +29,7 @@ * --------------------------------------------------------------------- */ class PluginFormcreatorUpgradeTo2_10 { + protected $migration; /** @@ -55,5 +56,11 @@ public function upgrade(Migration $migration) { $migration->changeField($table, 'type', 'type_question', 'integer', ['after' => 'target_name', 'value' => '0']); $migration->migrationOneTable($table); $migration->addField($table, 'type_rule', 'integer', ['after' => 'target_name', 'value' => '1']); + + // conditions on targets + $table = 'glpi_plugin_formcreator_targetchanges'; + $migration->addField($table, 'show_rule', 'integer', ['value' => '1', 'after' => 'category_question']); + $table = 'glpi_plugin_formcreator_targettickets'; + $migration->addField($table, 'show_rule', 'integer', ['value' => '1', 'after' => 'location_question']); } } diff --git a/install/upgrade_to_2.11.php b/install/upgrade_to_2.11.php index 20fa93de4..d220bdd3d 100644 --- a/install/upgrade_to_2.11.php +++ b/install/upgrade_to_2.11.php @@ -78,12 +78,6 @@ public function upgrade(Migration $migration) { ) or plugin_formcreator_upgrade_error($migration); } - // conditions on targets - $table = 'glpi_plugin_formcreator_targetchanges'; - $migration->addField($table, 'show_rule', 'integer', ['value' => '1', 'after' => 'category_question']); - $table = 'glpi_plugin_formcreator_targettickets'; - $migration->addField($table, 'show_rule', 'integer', ['value' => '1', 'after' => 'location_question']); - // Move uuid field at last position $table = 'glpi_plugin_formcreator_targettickets'; $migration->addPostQuery("ALTER TABLE `$table` MODIFY `uuid` varchar(255) DEFAULT NULL AFTER `show_rule`");