Skip to content

Commit

Permalink
feat(install): Use InnoDB as DB table engine
Browse files Browse the repository at this point in the history
Signed-off-by: btry <tbugier@teclib.com>
  • Loading branch information
cedric-anne authored and btry committed Aug 28, 2018
1 parent 3cf510a commit 0385c20
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
40 changes: 20 additions & 20 deletions install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_answers` (
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_forms_answers_id` (`plugin_formcreator_forms_answers_id`),
INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -25,13 +25,13 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_categories` (
INDEX `name` (`name`),
INDEX `knowbaseitemcategories_id` (`knowbaseitemcategories_id`),
INDEX `plugin_formcreator_categories_id` (`plugin_formcreator_categories_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_entityconfigs` (
`id` int(11) NOT NULL,
`replace_helpdesk` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms` (
INDEX `entities_id` (`entities_id`),
INDEX `plugin_formcreator_categories_id` (`plugin_formcreator_categories_id`),
FULLTEXT KEY `Search` (`name`,`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_answers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -76,7 +76,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_answers` (
INDEX `requester_id` (`requester_id`),
INDEX `users_id_validator` (`users_id_validator`),
INDEX `groups_id_validator` (`groups_id_validator`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_profiles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -85,7 +85,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_profiles` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`profiles_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_validators` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_validators` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`itemtype`,`items_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questions` (
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_sections_id` (`plugin_formcreator_sections_id`),
FULLTEXT KEY `Search` (`name`,`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questions_conditions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questions_conditions` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_sections` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -139,7 +139,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_sections` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -167,7 +167,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` (
`category_question` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `changetemplates_id` (`changetemplates_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges_actors` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -179,7 +179,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges_actors` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_targetchanges_id` (`plugin_formcreator_targetchanges_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -191,7 +191,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targets` (
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`),
INDEX `itemtype_items_id` (`itemtype`, `items_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -216,7 +216,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets` (
`category_question` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `tickettemplates_id` (`tickettemplates_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets_actors` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -228,7 +228,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets_actors` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_targettickets_id` (`plugin_formcreator_targettickets_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -249,7 +249,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` (
INDEX `entities_id` (`entities_id`),
INDEX `requester_id` (`requester_id`),
INDEX `validator_id` (`validator_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_items_targettickets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -261,7 +261,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_items_targettickets` (
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_targettickets_id` (`plugin_formcreator_targettickets_id`),
INDEX `item` (`itemtype`,`items_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questiondependencies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -272,7 +272,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questiondependencies` (
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`),
INDEX `plugin_formcreator_questions_id_2` (`plugin_formcreator_questions_id_2`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionregexes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -282,7 +282,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionregexes` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionranges` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -293,4 +293,4 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionranges` (
`uuid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1 change: 0 additions & 1 deletion install/update_2.6_2.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,4 @@ function plugin_formcreator_update_2_7(Migration $migration) {
$id = $row['id'];
$DB->query("UPDATE `glpi_plugin_formcreator_questions` SET `name`='$name' WHERE `id` = '$id'");
}

}

0 comments on commit 0385c20

Please sign in to comment.