Skip to content

Commit

Permalink
fix(targetchange): changes don't support template
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 6, 2018
1 parent e57bd69 commit 08236c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_sections` (
CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`changetemplates_id` int(11) DEFAULT NULL,
`content` longtext,
`impactcontent` longtext,
`controlistcontent` longtext,
Expand All @@ -164,8 +163,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` (
`tag_specifics` varchar(255) NOT NULL,
`category_rule` enum('none','specific','answer') NOT NULL DEFAULT 'none',
`category_question` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `changetemplates_id` (`changetemplates_id`)
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges_actors` (
Expand Down
4 changes: 4 additions & 0 deletions install/update_2.6_2.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
function plugin_formcreator_update_2_7(Migration $migration) {
global $DB;

// Changes don't support templates, remove the relation
$table = 'glpi_plugin_formcreator_targetchanges';
$migration->dropField($table, 'changetemplates_id');

// Migrate regex question parameters
$table = 'glpi_plugin_formcreator_questions';
if ($DB->fieldExists($table, 'regex')) {
Expand Down

0 comments on commit 08236c7

Please sign in to comment.