diff artifact-database/src/main/resources/sql/org-postgresql-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-postgresql-driver.properties	Thu Mar 03 10:54:33 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Thu Mar 03 12:13:24 2011 +0000
@@ -39,11 +39,16 @@
 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 (?, ?::uuid, ?, ?, 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 = ?
 

http://dive4elements.wald.intevation.org