diff artifact-database/src/main/resources/sql/org-h2-driver.properties @ 550:68f01f10624e

Introduced helper for finding the user name for a given artifact
author gernotbelger
date Fri, 09 Feb 2018 13:26:19 +0100
parents e9abf747f6ce
children
line wrap: on
line diff
--- a/artifact-database/src/main/resources/sql/org-h2-driver.properties	Mon Feb 22 17:25:21 2016 +0100
+++ b/artifact-database/src/main/resources/sql/org-h2-driver.properties	Fri Feb 09 13:26:19 2018 +0100
@@ -196,3 +196,10 @@
                 INNER JOIN collection_items ci ON c.id = ci.collection_id \
                 INNER JOIN artifacts a         ON a.id = ci.artifact_id \
         ORDER BY u_gid, c_gid
+
+find.user.by.artifact = \
+	SELECT users.id, users.name FROM users, collections, collection_items, artifacts \
+	WHERE users.id = collections.owner_id AND \
+		  collections.id = collection_items.collection_id AND \
+		  collection_items.artifact_id = artifacts.id AND \
+		  artifacts.gid = ?::uuid

http://dive4elements.wald.intevation.org