Skip to content

Commit

Permalink
fix: timestamps in DB
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 13, 2021
1 parent 3d86a3f commit e8649b9
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 NOT NULL DEFAULT CURRENT_TIMESTAMP,
`request_date` timestamp NULL,
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_mod` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_creation` timestamp NULL,
`date_mod` timestamp NULL,
`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'. ' NOT NULL DEFAULT CURRENT_TIMESTAMP');
$migration->changeField($table, 'request_date', 'request_date', 'timestamp');

$table = 'glpi_plugin_formcreator_issues';
$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');
$migration->changeField($table, 'date_creation', 'date_creation', 'timestamp');
$migration->changeField($table, 'date_mod', 'date_mod', 'timestamp');

$this->changeDropdownTreeSettings();

Expand Down

0 comments on commit e8649b9

Please sign in to comment.