From: "RubyTalk@..." Date: 2008-04-13T04:27:04+09:00 Subject: Re: How to check record duplication before saving? I like to use guids for ids. create_table(:name,{:id=>false}) do |t| t.column(:id,:string,:limit=>64) end execute(sql_statement_to_create_primary_key) Becker On Sat, Apr 12, 2008 at 9:34 AM, Todd Benson wrote: > On Fri, Apr 11, 2008 at 6:43 PM, Todd Benson wrote: > > > You probably have a primary key constraint on one of the columns > > (unless you are using kindergarten SQLite). > > That probably sounded bad. Sorry. > > > > Example without correct > > caps... > > > > create table stuff ( > > colA int not null, > > colB int not null, > > primary key (colA, colB) > > ) > > > > ...or if you succumb to the idea integer IDs for the primary key are a > > good idea... > > > > create table stuff ( > > id int not null primary key, > > colA int not null, > > colB int not null, > > unique (colA, colB) > > ) > > In rails, I should point out I _have_ to use the integer ID for my > primary key, which irks me to no end because it goes against > everything I know about set theory. That whining aside, I might try > to fix it, but the underlying rails code is intimidating. > > Todd > >