comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 229:328ef982d768

When an artifact is touched the collections which contain the artifact are touched, too. artifacts/trunk@1631 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 31 Mar 2011 08:58:42 +0000
parents a9c8fa38ba03
children 1ea35226a6de
comparison
equal deleted inserted replaced
228:dd977fb7552e 229:328ef982d768
82 SELECT a.gid, ci.attribute FROM collection_items ci \ 82 SELECT a.gid, ci.attribute FROM collection_items ci \
83 INNER JOIN artifacts a ON ci.artifact_id = a.id \ 83 INNER JOIN artifacts a ON ci.artifact_id = a.id \
84 WHERE ci.collection_id IN (SELECT id FROM collections WHERE gid = ?) 84 WHERE ci.collection_id IN (SELECT id FROM collections WHERE gid = ?)
85 85
86 # COLLECTIONS 86 # COLLECTIONS
87
88 collections.touch.trigger.function = \
89 UPDATE collections SET last_access = current_timestamp \
90 WHERE id IN \
91 (SELECT c.id FROM collections c \
92 INNER JOIN collection_items ci ON c.id = ci.collection_id \
93 INNER JOIN artifacts a ON a.id = ci.artifact_id \
94 WHERE a.id = ?)
95
96
87 collections.touch.by.gid =\ 97 collections.touch.by.gid =\
88 UPDATE collections SET last_access = CURRENT_TIMESTAMP \ 98 UPDATE collections SET last_access = CURRENT_TIMESTAMP \
89 WHERE gid = ? 99 WHERE gid = ?
90 100
91 collections.touch.by.id =\ 101 collections.touch.by.id =\

http://dive4elements.wald.intevation.org