comparison artifact-database/doc/schema-pg.sql @ 124:caf9f456f7e3

Added SQL statements to handle users in database. artifacts/trunk@1348 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 01 Mar 2011 17:43:16 +0000
parents 720d65bbba13
children a76de72ad6d1
comparison
equal deleted inserted replaced
123:9187abefba8b 124:caf9f456f7e3
20 20
21 CREATE SEQUENCE USERS_ID_SEQ; 21 CREATE SEQUENCE USERS_ID_SEQ;
22 22
23 CREATE TABLE users ( 23 CREATE TABLE users (
24 id int PRIMARY KEY NOT NULL, 24 id int PRIMARY KEY NOT NULL,
25 gid uuid NOT NULL, 25 gid uuid NOT NULL UNIQUE,
26 name VARCHAR(256) NOT NULL UNIQUE, 26 name VARCHAR(256) NOT NULL UNIQUE,
27 role BINARY 27 role BINARY
28 ); 28 );
29 29
30 CREATE SEQUENCE COLLECTIONS_ID_SEQ; 30 CREATE SEQUENCE COLLECTIONS_ID_SEQ;
31 31
32 CREATE TABLE collections ( 32 CREATE TABLE collections (
33 id int PRIMARY KEY NOT NULL, 33 id int PRIMARY KEY NOT NULL,
34 gid uuid NOT NULL, 34 gid uuid NOT NULL UNIQUE,
35 name VARCHAR(256) NOT NULL, 35 name VARCHAR(256) NOT NULL,
36 owner_id int NOT NULL REFERENCES users(id), 36 owner_id int NOT NULL REFERENCES users(id),
37 creation timestamp NOT NULL, 37 creation timestamp NOT NULL,
38 last_access timestamp NOT NULL, 38 last_access timestamp NOT NULL,
39 ttl bigint, -- NULL means eternal 39 ttl bigint, -- NULL means eternal

http://dive4elements.wald.intevation.org