Skip to content

Commit

Permalink
fix(install): prevent ON UPDATE statement in table description
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 30, 2021
1 parent 4bdbdb8 commit ab32142
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_formanswers` (
`requester_id` int(11) DEFAULT NULL,
`users_id_validator` int(11) NOT NULL DEFAULT '0',
`groups_id_validator` int(11) NOT NULL DEFAULT '0',
`request_date` timestamp NULL DEFAULT NULL,
`request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` int(11) NOT NULL DEFAULT '101',
`comment` text,
PRIMARY KEY (`id`),
Expand Down Expand Up @@ -246,8 +246,8 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` (
`original_id` int(11) NOT NULL DEFAULT '0',
`sub_itemtype` varchar(100) NOT NULL DEFAULT '',
`status` varchar(255) NOT NULL DEFAULT '',
`date_creation` timestamp NULL DEFAULT NULL,
`date_mod` timestamp NULL DEFAULT NULL,
`date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_mod` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`entities_id` int(11) NOT NULL DEFAULT '0',
`is_recursive` tinyint(1) NOT NULL DEFAULT '0',
`requester_id` int(11) NOT NULL DEFAULT '0',
Expand Down
6 changes: 3 additions & 3 deletions install/upgrade_to_2.12.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public function upgrade(Migration $migration) {

// Convert datetime to timestamp
$table = 'glpi_plugin_formcreator_formanswers';
$migration->changeField($table, 'request_date', 'request_date', 'timestamp');
$migration->changeField($table, 'request_date', 'request_date', 'timestamp'. ' NOT NULL DEFAULT CURRENT_TIMESTAMP');

$table = 'glpi_plugin_formcreator_issues';
$migration->changeField($table, 'date_creation', 'date_creation', 'timestamp');
$migration->changeField($table, 'date_mod', 'date_mod', 'timestamp');
$migration->changeField($table, 'date_creation', 'date_creation', 'timestamp'. ' NOT NULL DEFAULT CURRENT_TIMESTAMP');
$migration->changeField($table, 'date_mod', 'date_mod', 'timestamp'. ' NOT NULL DEFAULT CURRENT_TIMESTAMP');

$this->changeDropdownTreeSettings();

Expand Down

0 comments on commit ab32142

Please sign in to comment.