On Apr 28, 1:18 pm, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On 28 Apr 2011, at 13:13, Owain <owain.mcgu...@gmail.com> wrote:
>
>
>
>
>
> > On Apr 28, 12:57 pm, Frederick Cheung <frederick.che...@gmail.com>
> > wrote:
>
> >>> mysql> insert into confirmations (quote_id) values(188);
> >>> Query OK, 1 row affected (0.01 sec)
>
> >>> mysql> select * from confirmations where quote_id = 188;
>
> >> Why are you filtering by quote_id here?
>
> > Fred,
>
> > Just to show that the mysql CLI client allowed me to manually add
> > another row with the same quote_id of 188. So it is not mysql server
> > that is reporting the Duplicate Entry/Statement invalid. It is being
> > reported by the mysql adapter of ActiveRecord.
>
> On closer inspection it may be that the duplicate entry error is coming from the primary key (your insert was explicitly setting the id to 185)
>
> Fred
>
Fred,
You are absolutely correct. It should be auto_increment but I have
set it explicitly in my code.
Thank you very much for your help. You do a grand job on this list.
O.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment