From 105ef5e0142d33c0dc24f7f0422f279e4ef1fc23 Mon Sep 17 00:00:00 2001 From: sostler Date: Tue, 24 Nov 2009 23:43:43 -0500 Subject: Added persistent rooms --- db/0-create.psql | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'db') diff --git a/db/0-create.psql b/db/0-create.psql index 39b4efd..d34ccdd 100755 --- a/db/0-create.psql +++ b/db/0-create.psql @@ -9,7 +9,7 @@ CREATE TABLE users ( CREATE TABLE rooms ( room_id SERIAL PRIMARY KEY, name text UNIQUE NOT NULL, - created_on timestamp NOT NULL + created_on timestamp NOT NULL DEFAULT now() ); CREATE TABLE messages ( @@ -17,12 +17,14 @@ CREATE TABLE messages ( user_id integer NOT NULL REFERENCES users, room_id integer NOT NULL REFERENCES rooms, content text NOT NULL, - created_on timestamp NOT NULL + created_on timestamp NOT NULL DEFAULT now() ); CREATE TABLE user_session ( - session_id bigint PRIMARY KEY, + session_id bigint NOT NULL, user_id integer NOT NULL REFERENCES users, - id_address text NOT NULL, - ttl timestamp NOT NULL -); \ No newline at end of file + ttl timestamp NOT NULL, + PRIMARY KEY (session_id, user_id) +); + +INSERT INTO rooms (room_id, name) VALUES (1, 'dumpfm'); \ No newline at end of file -- cgit v1.2.3-70-g09d2