comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 314:31ee2b3b5a57

forward list of deleted collections and artifacts from data cleaner to backend to backend listeners. artifacts/trunk@2445 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 02 Aug 2011 11:11:59 +0000
parents a077bb098eb4
children 824051dff018
comparison
equal deleted inserted replaced
313:ddc35c950e97 314:31ee2b3b5a57
7 artifacts.update=UPDATE artifacts SET last_access = CURRENT_TIMESTAMP, \ 7 artifacts.update=UPDATE artifacts SET last_access = CURRENT_TIMESTAMP, \
8 data = ? WHERE id = ? 8 data = ? WHERE id = ?
9 9
10 artifacts.touch=UPDATE artifacts SET last_access = CURRENT_TIMESTAMP WHERE id = ? 10 artifacts.touch=UPDATE artifacts SET last_access = CURRENT_TIMESTAMP WHERE id = ?
11 11
12 artifacts.outdated=SELECT id, factory, data FROM artifacts WHERE ttl IS NOT NULL \ 12 artifacts.outdated=SELECT id, factory, data, gid FROM artifacts WHERE ttl IS NOT NULL \
13 AND DATEDIFF('MILLISECOND', last_access, CURRENT_TIMESTAMP) > ttl \ 13 AND DATEDIFF('MILLISECOND', last_access, CURRENT_TIMESTAMP) > ttl \
14 AND id NOT IN (SELECT DISTINCT artifact_id FROM collection_items) \ 14 AND id NOT IN (SELECT DISTINCT artifact_id FROM collection_items) \
15 AND id NOT IN ($LOCKED_IDS$) \ 15 AND id NOT IN ($LOCKED_IDS$) \
16 LIMIT 50 16 LIMIT 50
17 17
89 ORDER BY ci.creation 89 ORDER BY ci.creation
90 90
91 # COLLECTIONS 91 # COLLECTIONS
92 92
93 collections.outdated= \ 93 collections.outdated= \
94 SELECT c.id FROM collections c \ 94 SELECT c.id, c.gid FROM collections c \
95 INNER JOIN collection_items ci ON c.id = ci.collection_id \ 95 INNER JOIN collection_items ci ON c.id = ci.collection_id \
96 INNER JOIN artifacts a ON ci.artifact_id = a.id \ 96 INNER JOIN artifacts a ON ci.artifact_id = a.id \
97 WHERE c.ttl IS NOT NULL \ 97 WHERE c.ttl IS NOT NULL \
98 AND DATEDIFF('MILLISECOND', c.last_access, CURRENT_TIMESTAMP) > c.ttl \ 98 AND DATEDIFF('MILLISECOND', c.last_access, CURRENT_TIMESTAMP) > c.ttl \
99 AND a.id NOT IN ($LOCKED_IDS$) 99 AND a.id NOT IN ($LOCKED_IDS$)

http://dive4elements.wald.intevation.org