improved start page performance; top rating statistics was very slow

needs a new database field with manual init, see db-changes.txt !

and fixed another recommendation bug:
- recommendations will not get lost when a user edits one of multiple logs
  for the same cache
This commit is contained in:
following
2012-08-24 23:58:18 +02:00
parent 038719fa3c
commit c32a4b06ff
6 changed files with 34 additions and 39 deletions
+4
View File
@@ -15,3 +15,7 @@ date commit ID change
- add caches.okapi_syncbase, initialize it and add corresponding index
- add and initialize cache_logs(_archived).okapi_syncbase
See installation instructions at http://code.google.com/p/opencaching-api
2012-08-24 added cache_rating.rating_date and index 'date'; must be initialized by:
UPDATE cache_rating SET rating_date = (SELECT MIN(`date`) FROM cache_logs WHERE cache_logs.cache_id=cache_rating.cache_id AND cache_logs.user_id=cache_rating.user_id AND cache_logs.type IN (1,7))
added trigger cacheRatingBeforeInsert
+7
View File
@@ -668,6 +668,13 @@
INSERT IGNORE INTO `removed_objects` (`localId`, `uuid`, `type`, `node`) VALUES (OLD.`id`, OLD.`uuid`, 1, OLD.`node`);
END;");
sql_dropTrigger('cacheRatingBeforeInsert');
sql("CREATE TRIGGER `cacheRatingBeforeInsert` BEFORE INSERT ON `cache_rating`
FOR EACH ROW
BEGIN
SET NEW.`rating_date` = NOW();
END;");
sql_dropTrigger('cacheRatingAfterInsert');
sql("CREATE TRIGGER `cacheRatingAfterInsert` AFTER INSERT ON `cache_rating`
FOR EACH ROW