comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 343:542caebea773

Add functionality to get 'oldest' artifact of a collection.' artifacts/trunk@3037 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 19 Oct 2011 15:55:33 +0000
parents 560d2e6eaf9c
children 2d525562fae9
comparison
equal deleted inserted replaced
342:9a85e0ef6e02 343:542caebea773
135 (id, gid, name, owner_id, creation, last_access, ttl, attribute) \ 135 (id, gid, name, owner_id, creation, last_access, ttl, attribute) \
136 VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?, ?) 136 VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?, ?)
137 137
138 collection.creation.time=SELECT creation from collections WHERE id = ? 138 collection.creation.time=SELECT creation from collections WHERE id = ?
139 139
140 collections.artifacts.oldest=SELECT a.gid, ci.artifact_id \
141 FROM artifacts AS a, collection_items AS ci, collections AS c \
142 WHERE ci.collection_id = c.id AND c.gid = ?::uuid AND ci.artifact_id = a.id \
143 ORDER BY ci.creation
144
140 collections.select.user= \ 145 collections.select.user= \
141 SELECT c.gid, c.name, c.creation, u.gid, c.ttl FROM \ 146 SELECT c.gid, c.name, c.creation, u.gid, c.ttl FROM \
142 collections c LEFT OUTER JOIN users u ON c.owner_id = u.id \ 147 collections c LEFT OUTER JOIN users u ON c.owner_id = u.id \
143 WHERE u.gid = ? 148 WHERE u.gid = ?
144 149

http://dive4elements.wald.intevation.org