From 7e82e94b557fd20cdc10ddd3c036d8feb9c2e7ce Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 20 Dec 2015 17:49:09 -0800 Subject: [PATCH] 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. --- sql/supporters-schema.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/sql/supporters-schema.sql b/sql/supporters-schema.sql index 10de84a..27960a4 100644 --- a/sql/supporters-schema.sql +++ b/sql/supporters-schema.sql @@ -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" (