comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 180:38fbbeffe8fe

Added code to remove an artifact from a collection artifacts/trunk@1406 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 06 Mar 2011 11:49:00 +0000
parents 644fd11ddd9f
children 116482169b44
comparison
equal deleted inserted replaced
179:644fd11ddd9f 180:38fbbeffe8fe
59 SELECT ci.id FROM collections_items ci \ 59 SELECT ci.id FROM collections_items ci \
60 INNER JOIN collection c ON ci.collection_id = c.id \ 60 INNER JOIN collection c ON ci.collection_id = c.id \
61 INNER JOIN attributes a ON ci.artifact_id = a.id \ 61 INNER JOIN attributes a ON ci.artifact_id = a.id \
62 WHERE c.gid = ? AND a.gid = ?) 62 WHERE c.gid = ? AND a.gid = ?)
63 63
64 collection.item.id.cid.aid= \
65 SELECT ci.id, c.collection_id, c.artifact_id FROM collections_items ci \
66 INNER JOIN collection c ON ci.collection_id = c.id \
67 INNER JOIN attributes a ON ci.artifact_id = a.id \
68 WHERE c.gid = ? AND a.gid = ?
69
70 collection.item.outdate.artifact= \
71 UPDATE artifacts \
72 SET last_access = DATEADD('MILLISECOND', -2, CURRENT_TIMESTAMP), ttl = 1 \
73 WHERE id = ? AND \
74 NOT EXSITS (SELECT id FROM collections_items WHERE <> collection_id = ?)
75
76 collection.item.delete=DELETE FROM collections_items WHERE id = ?
77
64 # COLLECTIONS 78 # COLLECTIONS
65 collections.touch.by.gid =\ 79 collections.touch.by.gid =\
66 UPDATE collection SET last_access = CURRENT_TIMESTAMP \ 80 UPDATE collection SET last_access = CURRENT_TIMESTAMP \
67 WHERE gid = ? 81 WHERE gid = ?
82
83 collections.touch.by.id =\
84 UPDATE collection SET last_access = CURRENT_TIMESTAMP \
85 WHERE id = ?
68 86
69 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ') 87 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ')
70 88
71 collections.id.by.gid=SELECT id FROM collections WHERE gid = ? 89 collections.id.by.gid=SELECT id FROM collections WHERE gid = ?
72 90

http://dive4elements.wald.intevation.org