From 4560e2d824a99514ea6a2ca2a89c8d0453923fbc Mon Sep 17 00:00:00 2001
From: plegall <plg@piwigo.org>
Date: Tue, 31 May 2016 16:00:03 +0200
Subject: fixes #478, add new column user_infos.last_visit

This will speed up user edit popin opening, by avoiding to search in history for the last user visit.

The column user_infos.last_visit_from_history true/false says if the last_visit has already been search in history (to avoid making it twice). I could have implemented the search of last_visit for all users in the migration task 149 but in case of many users and long history, it would have taken years to execute...
---
 install/piwigo_structure-mysql.sql | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'install/piwigo_structure-mysql.sql')

diff --git a/install/piwigo_structure-mysql.sql b/install/piwigo_structure-mysql.sql
index 1c7853edc..e1c076320 100644
--- a/install/piwigo_structure-mysql.sql
+++ b/install/piwigo_structure-mysql.sql
@@ -460,6 +460,8 @@ CREATE TABLE `piwigo_user_infos` (
   `level` tinyint unsigned NOT NULL default '0',
   `activation_key` varchar(255) default NULL,
   `activation_key_expire` datetime default NULL,
+  `last_visit` datetime default NULL,
+  `last_visit_from_history` enum('true','false') NOT NULL default 'false'
   `lastmodified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   PRIMARY KEY (`user_id`),
   KEY `lastmodified` (`lastmodified`)
-- 
cgit v1.2.3


From 3f1dbf19c5ef84ae048501f6270e74d7d9638a71 Mon Sep 17 00:00:00 2001
From: plegall <plg@piwigo.org>
Date: Tue, 31 May 2016 16:11:19 +0200
Subject: typo fixed, missing comma

---
 install/piwigo_structure-mysql.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'install/piwigo_structure-mysql.sql')

diff --git a/install/piwigo_structure-mysql.sql b/install/piwigo_structure-mysql.sql
index e1c076320..76e9fe90b 100644
--- a/install/piwigo_structure-mysql.sql
+++ b/install/piwigo_structure-mysql.sql
@@ -461,7 +461,7 @@ CREATE TABLE `piwigo_user_infos` (
   `activation_key` varchar(255) default NULL,
   `activation_key_expire` datetime default NULL,
   `last_visit` datetime default NULL,
-  `last_visit_from_history` enum('true','false') NOT NULL default 'false'
+  `last_visit_from_history` enum('true','false') NOT NULL default 'false',
   `lastmodified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   PRIMARY KEY (`user_id`),
   KEY `lastmodified` (`lastmodified`)
-- 
cgit v1.2.3

