Skip to content

Commit 29a7c1d

Browse files
committed
fix(targetchange,targetticket): DB schema
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 791b1a2 commit 29a7c1d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

install/mysql/plugin_formcreator_empty.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` (
156156
`name` varchar(255) NOT NULL DEFAULT '',
157157
`plugin_formcreator_forms_id` int(11) NOT NULL DEFAULT '0',
158158
`target_name` varchar(255) NOT NULL DEFAULT '',
159-
`changetemplates_id` int(11) DEFAULT NULL,
159+
`changetemplates_id` int(11) NOT NULL DEFAULT '0',
160160
`content` longtext,
161161
`impactcontent` longtext,
162162
`controlistcontent` longtext,
@@ -195,7 +195,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets` (
195195
`target_name` varchar(255) NOT NULL DEFAULT '',
196196
`type_rule` int(11) NOT NULL DEFAULT '0',
197197
`type_question` int(11) NOT NULL DEFAULT '0',
198-
`tickettemplates_id` int(11) DEFAULT NULL,
198+
`tickettemplates_id` int(11) NOT NULL DEFAULT '0',
199199
`content` longtext,
200200
`due_date_rule` int(11) NOT NULL DEFAULT '1',
201201
`due_date_question` int(11) DEFAULT NULL,

install/upgrade_to_2.12.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ public function upgrade(Migration $migration) {
6161
$this->normalizeIssues();
6262

6363
$table = 'glpi_plugin_formcreator_targetchanges';
64-
$this->migration->addField($table, 'changetemplates_id', 'integer', ['after' => 'target_name']);
64+
$this->migration->addField($table, 'changetemplates_id', 'integer', ['value' => '0', 'after' => 'target_name']);
65+
66+
$table = 'glpi_plugin_formcreator_targettickets';
67+
$this->migration->changeField($table, 'tickettemplates_id', 'tickettemplates_id', 'integer', ['value' => '0', 'after' => 'type_question']);
6568
}
6669

6770
/**

0 commit comments

Comments
 (0)