diff artifact-database/src/main/resources/sql/org-postgresql-driver.properties @ 187:a85d889a1b0d

Fixed some backend specific stuff (sql statements, schema). artifacts/trunk@1417 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 07 Mar 2011 16:23:27 +0000
parents a22b7e367b25
children 3bce5556a2e5
line wrap: on
line diff
--- a/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Mon Mar 07 15:13:36 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Mon Mar 07 16:23:27 2011 +0000
@@ -38,31 +38,31 @@
 
 users.select.all=SELECT id, gid, name, role FROM users
 
-collection.check.artifact=SELECT id FROM collections_items \
+collection.check.artifact=SELECT id FROM collection_items \
     WHERE artifact_id = ? AND collection_id = ?
 
 # COLLECTION ITEMS
 collection.items.id.nextval=SELECT NEXTVAL('COLLECTION_ITEMS_ID_SEQ')
 
-collection.items.insert=INSERT INTO collections_items \
+collection.items.insert=INSERT INTO collection_items \
     (id, collection_id, artifact_id, attribute) \
     VALUES (?, ?, ?, ?)
 
 collection.item.get.attribute= \
-    SELECT ci.attribute FROM collections_items ci \
+    SELECT ci.attribute FROM collection_items ci \
         INNER JOIN collection c ON ci.collection_id = c.id \
         INNER JOIN attributes a ON ci.artifact_id = a.id \
         WHERE c.gid = ?::uuid AND a.gid = ?::uuid
 
 collection.item.set.attribute= \
-    UPDATE collections_items SET attribute = ? WHERE id IN ( \
-        SELECT ci.id FROM collections_items ci \
+    UPDATE collection_items SET attribute = ? WHERE id IN ( \
+        SELECT ci.id FROM collection_items ci \
             INNER JOIN collection c ON ci.collection_id = c.id \
             INNER JOIN attributes a ON ci.artifact_id = a.id \
             WHERE c.gid = ?::uuid AND a.gid = ?::uuid)
 
 collection.item.id.cid.aid= \
-    SELECT ci.id, c.collection_id, c.artifact_id FROM collections_items ci \
+    SELECT ci.id, c.collection_id, c.artifact_id FROM collection_items ci \
         INNER JOIN collection c ON ci.collection_id = c.id \
         INNER JOIN attributes a ON ci.artifact_id = a.id \
         WHERE c.gid = ?::uuid AND a.gid = ?::uuid
@@ -71,14 +71,14 @@
     UPDATE artifacts \
     SET last_access = CURRENT_TIMESTAMP - '2 microseconds'::interval, ttl = 1 \
     WHERE id = ? AND \
-    NOT EXSITS (SELECT id FROM collections_items WHERE <> collection_id = ?)
+    NOT EXSITS (SELECT id FROM collection_items WHERE <> collection_id = ?)
 
-collection.item.delete=DELETE FROM collections_items WHERE id = ?
+collection.item.delete=DELETE FROM collection_items WHERE id = ?
 
 collection.items.list.gid= \
-    SELECT a.gid, ci.attribute FROM collections_items ci \
+    SELECT a.gid, ci.attribute FROM collection_items ci \
     INNER JOIN artifacts a ON ci.artifact_id = a.id \
-    WHERE ci.id IN (SELECT id FROM collections WHERE gid = ?)
+    WHERE ci.id IN (SELECT id FROM collections WHERE gid = ?::uuid)
 
 # COLLECTIONS
 collections.touch.by.gid =\

http://dive4elements.wald.intevation.org