Won't auto_increment


#1

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


#2

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.


#3

… i’m so embarassed…

thanks, though


#4

embarrassed


#5

Kevin O. wrote:

And put ‘migrations’ on your list of things to look at soon. They take
that sort of problem away quite nicely.