From 1fa99ed135fd5332ff332c5e66e9815f2bb450d7 Mon Sep 17 00:00:00 2001 From: Ricky Zhou Date: Thu, 6 Mar 2008 22:16:11 -0500 Subject: [PATCH] Don't allow users/groups to "claim" an email before it is verified. --- fas/fas2.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fas/fas2.sql b/fas/fas2.sql index 25dfa93..9871e40 100644 --- a/fas/fas2.sql +++ b/fas/fas2.sql @@ -71,11 +71,12 @@ cluster people_status_idx on people; CREATE TABLE person_emails ( id serial primary key, - email text not null unique, + email text not null, person_id INTEGER NOT NULL references people(id), validtoken text, description text, verified boolean NOT NULL DEFAULT false + unique (email, verified) --You can't "claim" an email before you verify it first ); create index person_emails_person_id_idx on person_emails(person_id); @@ -141,11 +142,12 @@ cluster groups_group_type_idx on groups; -- CREATE TABLE group_emails ( id serial primary key, - email text not null unique, + email text not null, group_id INTEGER NOT NULL references groups(id), validtoken text, description text, verified boolean NOT NULL DEFAULT false + unique (email, verified) --You can't "claim" an email before you verify it first ); create index group_emails_group_id_idx on group_emails(group_id);