comparison artifact-database/src/main/resources/sql/org-postgresql-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 a22b7e367b25
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 = ?::uuid AND a.gid = ?::uuid) 62 WHERE c.gid = ?::uuid AND a.gid = ?::uuid)
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 = ?::uuid AND a.gid = ?::uuid
69
70 collection.item.outdate.artifact= \
71 UPDATE artifacts \
72 SET last_access = CURRENT_TIMESTAMP - '2 microseconds'::interval, 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 = ?::uuid 81 WHERE gid = ?::uuid
68 82
83 collections.touch.by.id =\
84 UPDATE collection SET last_access = CURRENT_TIMESTAMP \
85 WHERE id = ?
69 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ') 86 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ')
70 87
71 collections.id.by.gid=SELECT id FROM collections WHERE gid = ?::uuid 88 collections.id.by.gid=SELECT id FROM collections WHERE gid = ?::uuid
72 89
73 delete.collection.items=DELETE FROM collection_items WHERE collection_id = ? 90 delete.collection.items=DELETE FROM collection_items WHERE collection_id = ?

http://dive4elements.wald.intevation.org