Forum: Ruby on Rails won't auto_increment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bimo R. (Guest)
on 2006-01-23 06:04
I am writing my first RoR ap and am having problems with ActiveRecord's
basic functions.  The first one is that the id column is not auto
incrementing.  I can add one record but after that it says,
"Mysql::Error: #23000Duplicate entry '0' for key 1"...

b
Kevin O. (Guest)
on 2006-01-23 06:17
bimo remus wrote:
> I am writing my first RoR ap and am having problems with ActiveRecord's
> basic functions.  The first one is that the id column is not auto
> incrementing.  I can add one record but after that it says,
> "Mysql::Error: #23000Duplicate entry '0' for key 1"...
>
> b

Make sure your 'id' column in the MySQL table is defined as
auto_increment.
Bimo R. (Guest)
on 2006-01-23 06:45
...  i'm so embarassed...

thanks, though
Bimo R. (Guest)
on 2006-01-23 06:47
embarrassed
Alex Y. (Guest)
on 2006-01-23 14:06
(Received via mailing list)
Kevin O. wrote:
>
And put 'migrations' on your list of things to look at soon.  They take
that sort of problem away quite nicely.
This topic is locked and can not be replied to.