--- trunk/schema.sql	2005/05/15 16:32:36	17
+++ trunk/schema.sql	2005/05/17 11:09:08	33
@@ -1,7 +1,7 @@
 create table users (
 	id	serial,
 	email	text not null,
-	full_name text not null,
+	full_name text default '',
 	date	timestamp not null default now(),
 	active	boolean not null default true,
 	bounce_count int not null default 0,
@@ -9,6 +9,8 @@
 	primary key(id)
 );
 
+create unique index users_email_ind on users(email);
+
 create table lists (
 	id	serial,
 	name	text not null,
@@ -18,7 +20,8 @@
 	primary key(id)
 );
 
-create index lists_name_ind on lists(name);
+create unique index lists_name_ind on lists(name);
+create unique index lists_email_ind on lists(email);
 
 create table user_list (
 	user_id	int not null references users(id) on update cascade on delete cascade,
@@ -34,8 +37,6 @@
 	primary key(id)
 );
 
-create index messages_md5_ind on messages(md5);
-
 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,
