From ab284f0e5be219f5560844cfc5e4c0a48ba1142a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 28 Feb 2018 00:15:54 +0000 Subject: [PATCH] A fix for default values for datetimes for older MySQL versions. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 4 ++-- mysql.sql | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index a5f4bd52..8fb80ce6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.34.4033 | Copyright © Anuko | +  Anuko Time Tracker 1.17.34.4034 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index d84cf4f3..7f87d7b7 100755 --- a/dbinstall.php +++ b/dbinstall.php @@ -733,8 +733,8 @@ if ($_POST) { setChange("create unique index role_idx on tt_roles(team_id, rank, status)"); setChange("ALTER TABLE `tt_roles` ADD `description` varchar(255) default NULL AFTER `name`"); setChange("ALTER TABLE `tt_users` ADD `role_id` int(11) default NULL AFTER `role`"); - setChange("CREATE TABLE `tt_site_config` (`param_name` varchar(32) NOT NULL, `param_value` text default NULL, `created` datetime default CURRENT_TIMESTAMP, `updated` datetime ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`param_name`))"); - setChange("INSERT INTO `tt_site_config` (`param_name`, `param_value`) VALUES ('version_db', '1.17.34')"); + setChange("CREATE TABLE `tt_site_config` (`param_name` varchar(32) NOT NULL, `param_value` text default NULL, `created` datetime default NULL, `updated` datetime default NULL, PRIMARY KEY (`param_name`))"); + setChange("INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.34', now())"); } if ($_POST["cleanup"]) { diff --git a/mysql.sql b/mysql.sql index c37a32c4..fad0f92d 100644 --- a/mysql.sql +++ b/mysql.sql @@ -416,11 +416,11 @@ create unique index role_idx on tt_roles(team_id, rank, status); # For example, database version, code version, site language, etc. # CREATE TABLE `tt_site_config` ( - `param_name` varchar(32) NOT NULL, # parameter name - `param_value` text default NULL, # parameter value - `created` datetime default CURRENT_TIMESTAMP, # creation time - `updated` datetime ON UPDATE CURRENT_TIMESTAMP, # modification time + `param_name` varchar(32) NOT NULL, # parameter name + `param_value` text default NULL, # parameter value + `created` datetime default NULL, # creation time + `updated` datetime default NULL, # modification time PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`) VALUES ('version_db', '1.17.34'); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.34', now()); # TODO: change when structure changes. -- 2.20.1