Thursday, January 19, 2012

dealing with multicolumn unique indexes... best practice?

Hi all

What's the most Cake-ish way to deal with multicolumn unique indexes?

let me explain:

i have two models Material HABTM Mix.
I must keep track of some addtional infos (% of material for each mix) in the join table so, as stated in the cookbook, i scomposed the relationship in 2x hasMany.
Material hasMany MaterialMix hasMany Mix.
here comes the problem: each material can only be in a mix one time.
so the combination between materials_mixes.material_id and materials_mixes.mix_id must be unique.
how can i do that?

Note: the combination of field values must be unique, not the value itself

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: