diff artifact-database/src/main/resources/sql/org-h2-driver.properties @ 159:db0d20440b92

Added code to create collections. artifacts/trunk@1384 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 03 Mar 2011 12:13:24 +0000
parents 5369582d4fbf
children c9c27aca2f70
line wrap: on
line diff
--- a/artifact-database/src/main/resources/sql/org-h2-driver.properties	Thu Mar 03 10:54:33 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-h2-driver.properties	Thu Mar 03 12:13:24 2011 +0000
@@ -39,17 +39,22 @@
 users.select.all=SELECT id, gid, name, role FROM users
 
 # COLLECTIONS
+collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ')
 
 delete.user.collection.items= \
     DELETE FROM collection_items WHERE collection_id IN \
     (SELECT id FROM collections WHERE owner_id = ?)
 
+collections.insert= \
+    INSERT INTO collections (id, gid, name, owner_id, creation, last_access, ttl) \
+    VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?)
+
 users.collections=SELECT collection_id, gid, name FROM collections WHERE owner_id = ?
 users.collection.ids=SELECT collection_id FROM collections WHERE owner_id = ?
 
 users.delete.all.collections=DELETE FROM collections WHERE owner_id = ?
 
-artifacts.in.one.collection.only=\
+artifacts.in.one.collection.only= \
     SELECT artifact_id FROM collection_items\
     WHERE collection_id = ? AND\
     artifact_id NOT IN (SELECT DISTINCT artifact_id FROM collection_items WHERE collection_id <> ?)

http://dive4elements.wald.intevation.org