From: Frank Tsao Date: 2008-04-12T08:01:18+09:00 Subject: Re: How to check record duplication before saving? RubyTalk@gmail.com wrote: > If you are using Rails and migrations > > add_index(:table, [:column1, :column2], :unique => true) > > if not something like this sql > > CREATE UNIQUE INDEX index_name ON table(column1,column2); > > Becker Thanks for your help, but the situation in A=1, B=2 or A=2, B=1 that wont be accepted if using unique. My point is that when record(A=1, B=1) was existed in database, any new record(A=1, B=1) can not be valided. They can be (A=1, B=2), (A=1, B=3) or (A=5, B=1) etc. -- Posted via http://www.ruby-forum.com/.