⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

is_unique for two or more fields



manfredrunkel
  • profile picture
  • Member

Posted 13 February 2013 - 11:51 AM

Hi!

 

I would like to know if there are some way to add the unique rule for two or more fields,

 

for example,

 

i have this unique index

 

 

ALTER TABLE `mytable` 
ADD UNIQUE INDEX `uq` (`year` ASC, `month` ASC, `idclass` ASC)
 
i would like to prevent the user (and show a message) that he is not able to insert the value due the unique validation.
 
I've tried 
 
is_unique[mytable.month]|is_unique[mytable.year]
 
but didn't work.
 
Thank you

victor
  • profile picture
  • Member

Posted 14 February 2013 - 06:05 AM

there's some posts about is_unique problem. try use search.