From 27629359d28dcabcd68d8a15cfb03d090ad57bc9 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 8 Dec 2017 00:28:18 +0100 Subject: [PATCH] fixes #146 Add ON UPDATE CURRENT_TIMESTAMP to update_time --- migrations/V48__notes-per-user.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/V48__notes-per-user.sql b/migrations/V48__notes-per-user.sql index 5e806fdb..61f09713 100644 --- a/migrations/V48__notes-per-user.sql +++ b/migrations/V48__notes-per-user.sql @@ -5,8 +5,8 @@ CREATE TABLE user_notes author MEDIUMINT(9) unsigned NOT NULL, watched TINYINT(4) DEFAULT '0' NOT NULL COMMENT 'boolean that marks notes that should be reviewed at a later time (i.e. gather facts before applying a ban)', note TEXT NOT NULL, - create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, - update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, CONSTRAINT user_notes_user_login_id_fk FOREIGN KEY (user_id) REFERENCES login (id), CONSTRAINT user_notes_author_login_id_fk FOREIGN KEY (author) REFERENCES login (id) );