Skip to content

Commit

Permalink
fix(issue): allow null in name column
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 20, 2022
1 parent 7741573 commit bb32843
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targets_actors` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NULL DEFAULT NULL,
`display_id` varchar(255) NOT NULL,
`items_id` int unsigned NOT NULL DEFAULT '0',
`itemtype` varchar(255) NOT NULL DEFAULT '',
Expand Down
7 changes: 7 additions & 0 deletions install/upgrade_to_2.13.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function upgrade(Migration $migration) {
$this->addFormVisibility();
$this->addRequestSourceSetting();
$this->addEntityOption();
$this->fixissues();
}

public function addEntityOption() {
Expand Down Expand Up @@ -317,6 +318,12 @@ public function addDefaultFormListMode() {
$this->migration->addPostQuery("UPDATE `glpi_plugin_formcreator_entityconfigs` SET `default_form_list_mode`=0 WHERE `entities_id`=0");
}

public function fixissues() {
$table = 'glpi_plugin_formcreator_issues';

$this->migration->changeField($table, 'name', 'name', 'string', ['after' => 'id', 'nodefault' => true]);
}

public function isResyncIssuesRequiresd() {
return false;
}
Expand Down

0 comments on commit bb32843

Please sign in to comment.