Mercurial > dive4elements > framework
comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 193:949d69ad3756
Fixed issue with outdating an artifact if it is removed from a collection.
artifacts/trunk@1423 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 08 Mar 2011 10:13:45 +0000 |
parents | 3bce5556a2e5 |
children | 63f555bbdbc0 |
comparison
equal
deleted
inserted
replaced
192:dad6071c9072 | 193:949d69ad3756 |
---|---|
60 INNER JOIN collections c ON ci.collection_id = c.id \ | 60 INNER JOIN collections c ON ci.collection_id = c.id \ |
61 INNER JOIN artifacts a ON ci.artifact_id = a.id \ | 61 INNER JOIN artifacts 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= \ | 64 collection.item.id.cid.aid= \ |
65 SELECT ci.id, c.collection_id, c.artifact_id FROM collection_items ci \ | 65 SELECT ci.id, ci.collection_id, ci.artifact_id FROM collection_items ci \ |
66 INNER JOIN collection c ON ci.collection_id = c.id \ | 66 INNER JOIN collections c ON ci.collection_id = c.id \ |
67 INNER JOIN attributes a ON ci.artifact_id = a.id \ | 67 INNER JOIN artifacts a ON ci.artifact_id = a.id \ |
68 WHERE c.gid = ? AND a.gid = ? | 68 WHERE c.gid = ? AND a.gid = ? |
69 | 69 |
70 collection.item.outdate.artifact= \ | 70 collection.item.outdate.artifact= \ |
71 UPDATE artifacts \ | 71 UPDATE artifacts \ |
72 SET last_access = DATEADD('MILLISECOND', -2, CURRENT_TIMESTAMP), ttl = 1 \ | 72 SET last_access = DATEADD('MILLISECOND', -2, CURRENT_TIMESTAMP), ttl = 1 \ |
73 WHERE id = ? AND \ | 73 WHERE id = ? AND \ |
74 NOT EXSITS (SELECT id FROM collection_items WHERE <> collection_id = ?) | 74 NOT EXSITS \ |
75 (SELECT id FROM collection_items WHERE collection_id <> ? AND artifact_id = ?) | |
75 | 76 |
76 collection.item.delete=DELETE FROM collection_items WHERE id = ? | 77 collection.item.delete=DELETE FROM collection_items WHERE id = ? |
77 | 78 |
78 collection.items.list.gid= \ | 79 collection.items.list.gid= \ |
79 SELECT a.gid, ci.attribute FROM collection_items ci \ | 80 SELECT a.gid, ci.attribute FROM collection_items ci \ |