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 -- Posted via http://www.ruby-forum.com/.
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"... > > bMake sure your ''id'' column in the MySQL table is defined as auto_increment. -- Posted via http://www.ruby-forum.com/.
... i''m so embarassed... thanks, though -- Posted via http://www.ruby-forum.com/.
embarrassed -- Posted via http://www.ruby-forum.com/.
Kevin Olbrich wrote:> 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. >And put ''migrations'' on your list of things to look at soon. They take that sort of problem away quite nicely. -- Alex