Skip to content

Commit

Permalink
fix(targetchange,targetticket): DB schema
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jul 19, 2021
1 parent 791b1a2 commit 29a7c1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion install/upgrade_to_2.12.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

/**
Expand Down

0 comments on commit 29a7c1d

Please sign in to comment.