diff --git a/install/mysql/plugin_formcreator_empty.sql b/install/mysql/plugin_formcreator_empty.sql index c61720dd2..82717890e 100644 --- a/install/mysql/plugin_formcreator_empty.sql +++ b/install/mysql/plugin_formcreator_empty.sql @@ -156,7 +156,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` ( `name` varchar(255) NOT NULL DEFAULT '', `plugin_formcreator_forms_id` int(11) NOT NULL DEFAULT '0', `target_name` varchar(255) NOT NULL DEFAULT '', - `changetemplates_id` int(11) DEFAULT NULL, + `changetemplates_id` int(11) NOT NULL DEFAULT '0', `content` longtext, `impactcontent` longtext, `controlistcontent` longtext, @@ -195,7 +195,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets` ( `target_name` varchar(255) NOT NULL DEFAULT '', `type_rule` int(11) NOT NULL DEFAULT '0', `type_question` int(11) NOT NULL DEFAULT '0', - `tickettemplates_id` int(11) DEFAULT NULL, + `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `content` longtext, `due_date_rule` int(11) NOT NULL DEFAULT '1', `due_date_question` int(11) DEFAULT NULL, diff --git a/install/upgrade_to_2.12.php b/install/upgrade_to_2.12.php index 329f9f56a..b919ea2d0 100644 --- a/install/upgrade_to_2.12.php +++ b/install/upgrade_to_2.12.php @@ -61,7 +61,10 @@ public function upgrade(Migration $migration) { $this->normalizeIssues(); $table = 'glpi_plugin_formcreator_targetchanges'; - $this->migration->addField($table, 'changetemplates_id', 'integer', ['after' => 'target_name']); + $this->migration->addField($table, 'changetemplates_id', 'integer', ['value' => '0', 'after' => 'target_name']); + + $table = 'glpi_plugin_formcreator_targettickets'; + $this->migration->changeField($table, 'tickettemplates_id', 'tickettemplates_id', 'integer', ['value' => '0', 'after' => 'type_question']); } /**