From f5cb7ad3a6940859b1cd29e82bb213bfdcfa81a5 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Tue, 12 Dec 2017 19:50:48 +0100 Subject: [PATCH] adding DEFAULT for lastlogin, crashes on MariaDB --- install/mysql.sql | 2 +- install/upgrades/3.4.10.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 install/upgrades/3.4.10.sql diff --git a/install/mysql.sql b/install/mysql.sql index 93e81ee8..19fcd336 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -259,7 +259,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` ( `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. `bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot `messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot - `lastlogin` datetime NOT NULL, -- Last login, filled by dovecot + `lastlogin` datetime NOT NULL DEFAULT '0', -- Last login, filled by dovecot `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron PRIMARY KEY (`id`), UNIQUE KEY `address_id` (`address_id`) diff --git a/install/upgrades/3.4.10.sql b/install/upgrades/3.4.10.sql new file mode 100644 index 00000000..eb1bad9e --- /dev/null +++ b/install/upgrades/3.4.10.sql @@ -0,0 +1,2 @@ + +ALTER TABLE mailbox MODIFY `lastlogin` DATETIME NOT NULL DEFAULT 0;