Commander Johnson wrote: ...snip... > Gives the error: > > Mysql::Error: #23000Column 'type' cannot be null: INSERT INTO `elements` > (`form_id`, `ordering`, `name`, `title`, `type`, `value`, `flags`, > `created_at`, `updated_at`) VALUES(2, NULL, 'First Name', NULL, NULL, > '', > NULL, '2008-09-16 13:59:36', '2008-09-16 13:59:36') > > As you can see, the 'type' column somehow isn't inserted.
>From looking at that error it's clear that the 5th value sent is NULL which is your `type` column. So your problem is not with MySQL. Given that Rails uses a "type" column for single-table inheritance, maybe that has something to do with your issue. > I had similar issues when trying to add a column called 'timestamp'. MySQL has a TIMESTAMP data type. I would guess that you could use that as a column name as long as it's quoted properly (i.e. `timestamp`). I tend to avoid naming columns with likely database keywords (type, timestamp, data, time, number, text, etc.). P.S. I also avoid using TIMESTAMP data type in MySQL. It's may not behave as you might expect it to. If a column of that type is not send in a UPDATE statement it will automatically update itself to the current time of the database server. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

