diff --git a/install/upgrade_to_2.7.php b/install/upgrade_to_2.7.php index 15d05eb0e..e58e11ac3 100644 --- a/install/upgrade_to_2.7.php +++ b/install/upgrade_to_2.7.php @@ -116,6 +116,17 @@ public function upgrade(Migration $migration) { // Migrate regex question parameters $table = 'glpi_plugin_formcreator_questions'; if ($DB->fieldExists($table, 'regex')) { + $DB->query( + "CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionregexes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `plugin_formcreator_questions_id` int(11) NOT NULL, + `regex` text DEFAULT NULL, + `fieldname` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;" + ); $request = [ 'FROM' => $table, 'WHERE' => ['fieldtype' => ['float', 'integer', 'text', 'textarea']] @@ -134,6 +145,18 @@ public function upgrade(Migration $migration) { // Migrate range question parameters $table = 'glpi_plugin_formcreator_questions'; if ($DB->fieldExists($table, 'range_min')) { + $DB->query( + "CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionranges` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `plugin_formcreator_questions_id` int(11) NOT NULL, + `range_min` varchar(255) DEFAULT NULL, + `range_max` varchar(255) DEFAULT NULL, + `fieldname` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;" + ); $request = [ 'FROM' => $table, 'WHERE' => ['fieldtype' => ['float', 'integer', 'checkboxes', 'multiselect', 'text']]