--- trunk/schema.sql	2005/05/14 12:31:15	5
+++ trunk/schema.sql	2005/05/14 18:20:50	11
@@ -35,10 +35,11 @@
 
 create index messages_md5_ind on messages(md5);
 
-create table message_list (
+create table queue (
 	message_id int not null references messages(id) on update cascade on delete cascade,
-	list_id int not null references lists(id) on update cascade on delete cascade,
+	list_id	int not null references lists(id) on update cascade on delete cascade,
 	date	timestamp not null default now(),
+	all_sent boolean default false,
 	primary key(message_id, list_id)
 );
 
@@ -46,15 +47,16 @@
 	message_id int not null references messages(id) on update cascade on delete cascade,
 	user_id	int not null references users(id) on update cascade on delete cascade,
 	date	timestamp not null default now(),
-	sent	boolean not null default false,
 	primary key(message_id, user_id)
 );
 
 create table received (
-	user_id	not null references users(id) on update cascade on delete cascade,
+	id serial,
+	user_id	int not null references users(id) on update cascade on delete cascade,
 	message	text not null,
 	bounced	boolean not null default false,
 	date	timestamp not null default now(),
+	primary key (id)
 );
 
 
