you can also make this the primary key. might be simpler. also i think the unique_together is redundant, since case_id already has to be globally unique enforced by couch