Skip to content

Commit

Permalink
feat(targetticket,targetchange): conditions backported to 2.10
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 23, 2020
1 parent 65ff5a3 commit a236f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions install/upgrade_to_2.10.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* ---------------------------------------------------------------------
*/
class PluginFormcreatorUpgradeTo2_10 {

protected $migration;

/**
Expand All @@ -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']);
}
}
6 changes: 0 additions & 6 deletions install/upgrade_to_2.11.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`");
Expand Down

0 comments on commit a236f5e

Please sign in to comment.