comparison artifact-database/src/main/resources/sql/org-postgresql-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 08731e7403b5
comparison
equal deleted inserted replaced
342:9a85e0ef6e02 343:542caebea773
126 (id, gid, name, owner_id, creation, last_access, ttl, attribute) \ 126 (id, gid, name, owner_id, creation, last_access, ttl, attribute) \
127 VALUES (?, ?::uuid, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?, ?) 127 VALUES (?, ?::uuid, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?, ?)
128 128
129 collection.creation.time=SELECT creation from collections WHERE id = ? 129 collection.creation.time=SELECT creation from collections WHERE id = ?
130 130
131 collections.artifacts.oldest=SELECT a.gid, ci.artifact_id \
132 FROM artifacts AS a, collection_items AS ci, collections AS c \
133 WHERE ci.collection_id = c.id AND c.gid = ?::uuid AND ci.artifact_id = a.id \
134 ORDER BY ci.creation
135
131 collections.select.user= \ 136 collections.select.user= \
132 SELECT c.gid, c.name, c.creation, u.gid, c.ttl FROM \ 137 SELECT c.gid, c.name, c.creation, u.gid, c.ttl FROM \
133 collections c LEFT OUTER JOIN users u ON c.owner_id = u.id \ 138 collections c LEFT OUTER JOIN users u ON c.owner_id = u.id \
134 WHERE u.gid = ?::uuid 139 WHERE u.gid = ?::uuid
135 140

http://dive4elements.wald.intevation.org