From 8fe20251f363864a66ea116c5bbdb6f5c51855ec Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 24 Jun 2016 07:41:28 +0200 Subject: [PATCH] try to be more strict-mode compatible, fixes #1635 Signed-off-by: Michael Kaufmann (d00p) --- install/froxlor.sql | 8 ++++---- install/updates/froxlor/0.9/update_0.9.inc.php | 13 ++++++++++++- lib/version.inc.php | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/install/froxlor.sql b/install/froxlor.sql index 7de09553..54f62a4b 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -23,7 +23,7 @@ CREATE TABLE `ftp_users` ( `shell` varchar(255) NOT NULL default '/bin/false', `login_enabled` enum('N','Y') NOT NULL default 'N', `login_count` int(15) NOT NULL default '0', - `last_login` datetime NOT NULL default '0000-00-00 00:00:00', + `last_login` datetime default NULL, `up_count` int(15) NOT NULL default '0', `up_bytes` bigint(30) NOT NULL default '0', `down_count` int(15) NOT NULL default '0', @@ -272,7 +272,7 @@ CREATE TABLE `panel_ipsandports` ( `namevirtualhost_statement` tinyint(1) NOT NULL default '0', `vhostcontainer` tinyint(1) NOT NULL default '0', `vhostcontainer_servername_statement` tinyint(1) NOT NULL default '0', - `specialsettings` text, + `specialsettings` text default NULL, `ssl` tinyint(4) NOT NULL default '0', `ssl_cert_file` varchar(255) NOT NULL, `ssl_key_file` varchar(255) NOT NULL, @@ -560,14 +560,14 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_special_char_required', '0'), ('panel', 'password_special_char', '!?<>ยง$%+#=@'), ('panel', 'version', '0.9.36'), - ('panel', 'db_version', '201605180'); + ('panel', 'db_version', '201606190'); DROP TABLE IF EXISTS `panel_tasks`; CREATE TABLE `panel_tasks` ( `id` int(11) unsigned NOT NULL auto_increment, `type` int(11) NOT NULL default '0', - `data` text NOT NULL, + `data` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index cf1cdec5..c01fb274 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -3369,8 +3369,19 @@ if (isDatabaseVersion('201605120')) { if (isDatabaseVersion('201605170')) { showUpdateStep("Adding new dns-editor setting for customers"); - Database::query("ALTER TABLE `panel_customers` ADD `dnsenabled` tinyint(1) NOT NULL default '0' AFTER `perlenabled`;"); + Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `dnsenabled` tinyint(1) NOT NULL default '0' AFTER `perlenabled`;"); lastStepStatus(0); updateToDbVersion('201605180'); } + +if (isDatabaseVersion('201605180')) { + + showUpdateStep("Changing tables to be more mysql strict-mode compatible"); + Database::query("ALTER TABLE `".TABLE_FTP_USERS."` CHANGE `last_login` `last_login` DATETIME NULL DEFAULT NULL;"); + Database::query("ALTER TABLE `".TABLE_PANEL_IPSANDPORTS."` CHANGE `specialsettings` `specialsettings` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;"); + Database::query("ALTER TABLE `".TABLE_PANEL_TASKS."` CHANGE `data` `data` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;"); + lastStepStatus(0); + + updateToDbVersion('201606190'); +} diff --git a/lib/version.inc.php b/lib/version.inc.php index 924d7cf1..1bd799c0 100644 --- a/lib/version.inc.php +++ b/lib/version.inc.php @@ -19,7 +19,7 @@ $version = '0.9.36'; // Database version (YYYYMMDDC where C is a daily counter) -$dbversion = '201605180'; +$dbversion = '201606190'; // Distribution branding-tag (used for Debian etc.) $branding = '';