From 5c4d9aaf8c674183e38f5b7b499784714d025dc1 Mon Sep 17 00:00:00 2001 From: sostler Date: Mon, 4 Jan 2010 01:25:23 -0500 Subject: Fixed update bug --- db/0-create.psql | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'db') diff --git a/db/0-create.psql b/db/0-create.psql index 7bcffe6..be404be 100755 --- a/db/0-create.psql +++ b/db/0-create.psql @@ -12,7 +12,8 @@ CREATE TABLE users ( CREATE TABLE rooms ( room_id SERIAL PRIMARY KEY, name text UNIQUE NOT NULL, - created_on timestamp NOT NULL DEFAULT now() + created_on timestamp NOT NULL DEFAULT now(), + admin_only bool NOT NULL DEFAULT false ); CREATE TABLE messages ( @@ -21,14 +22,11 @@ CREATE TABLE messages ( room_id integer NOT NULL REFERENCES rooms, content text NOT NULL, created_on timestamp NOT NULL DEFAULT now(), - is_image bool + is_image bool NOT NULL ); -CREATE TABLE user_session ( - session_id bigint NOT NULL, - user_id integer NOT NULL REFERENCES users, - ttl timestamp NOT NULL, - PRIMARY KEY (session_id, user_id) -); +CREATE INDEX user_id_idx ON messages (user_id); +CREATE INDEX room_id_idx ON messages (room_id); +CREATE INDEX created_on_idx ON messages (created_on); INSERT INTO rooms (room_id, name) VALUES (1, 'dumpfm'); \ No newline at end of file -- cgit v1.2.3-70-g09d2