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:
		
							parent
							
								
									9474dacd6c
								
							
						
					
					
						commit
						7e82e94b55
					
				
					 1 changed files with 0 additions and 3 deletions
				
			
		|  | @ -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" ( | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn