Rolling with Ruby on Rails
Subject:   ActiveRecord::StatementInvalid in Recipe#create
Date:   2005-11-18 12:08:22
From:   eXium
'ActiveRecord::StatementInvalid in Recipe#create   -- #HY000 Field 'id' doesn't have a default value'

That is the error I recieved when I first tried to enter data using /recipe/new. I was not sure what was going on at first, but soon had to dig back in to my brain.

I used SQLyog as my front-end [I am not a fan of trials, and if I was going to get used to it; i am never sure if i am going to buy it]. I thought maybe because I used a different front-end something might be off. As I saw above, something about the 'magic id' creation. I then went in to my front end and added a row successfully when id was given and actual number. [I encountered another error after this, but I can not seem to replicate it.]

Is 'id' primary/not null/auto-increment?
Possibly another error that I am way off of?

[Sorry about being a newbie]

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Curt Hibbs photo ActiveRecord::StatementInvalid in Recipe#create
    2005-11-18 23:32:16  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    Did you try downloading and running the zipped up source code and database content? If that works, then you can compare it with your own source code to see what's different.