Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder upgrade phases #1234

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions install/upgrade_to_2.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']]
Expand All @@ -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']]
Expand Down