Can't enforce one preferred email with UNIQUE key

The problem is that the supporter can have multiple non-preferred email
addresses.

I'd have to investigate if there's a way to make a UNIQUE key on a value
set to a specific value.
This commit is contained in:
Bradley M. Kuhn 2015-12-20 17:49:09 -08:00
parent 9474dacd6c
commit 7e82e94b55

View file

@ -72,9 +72,6 @@ CREATE TABLE "supporter_email_address_mapping" (
PRIMARY KEY(supporter_id, email_address_id)
);
CREATE UNIQUE INDEX supporter_email_address_mapping__single_prefferred_per_supporter
ON supporter_email_address_mapping(supporter_id, preferred);
DROP TABLE IF EXISTS "address_type";
CREATE TABLE "address_type" (