Skip to content

Commit e8649b9

Browse files
committed
fix: timestamps in DB
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 3d86a3f commit e8649b9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

install/mysql/plugin_formcreator_empty.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_formanswers` (
7575
`requester_id` int(11) DEFAULT NULL,
7676
`users_id_validator` int(11) NOT NULL DEFAULT '0',
7777
`groups_id_validator` int(11) NOT NULL DEFAULT '0',
78-
`request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
78+
`request_date` timestamp NULL,
7979
`status` int(11) NOT NULL DEFAULT '101',
8080
`comment` text,
8181
PRIMARY KEY (`id`),
@@ -246,8 +246,8 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` (
246246
`original_id` int(11) NOT NULL DEFAULT '0',
247247
`sub_itemtype` varchar(100) NOT NULL DEFAULT '',
248248
`status` varchar(255) NOT NULL DEFAULT '',
249-
`date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
250-
`date_mod` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
249+
`date_creation` timestamp NULL,
250+
`date_mod` timestamp NULL,
251251
`entities_id` int(11) NOT NULL DEFAULT '0',
252252
`is_recursive` tinyint(1) NOT NULL DEFAULT '0',
253253
`requester_id` int(11) NOT NULL DEFAULT '0',

install/upgrade_to_2.12.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public function upgrade(Migration $migration) {
4242

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

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

5151
$this->changeDropdownTreeSettings();
5252

0 commit comments

Comments
 (0)