I have a "journals" table (created with a rails migration but with "id"
renamed to "id_journal") with auto-incrementing primary key
"id_journal".
class Journal < ActiveRecord::Base
set_primary_key "id_journal"
end
Despite using set_primary_key in the Journal model, I get the following
error:
Mysql::Error: Failed to read auto-increment value from storage engine:
INSERT INTO `journals` (`jname`, `created_at`, `updated_at`,
`has_full_text_online`, `iscomplete`, `publisher`, `flagged`, `issn`,
`instance`, `link`, `subjects`) VALUES('Actas Dermo-Sifiliográficas
(English Edition)', '2010-04-14 04:27:42', '2010-04-14 04:27:42', NULL,
0, '', 0, '', 'SD-1', '', '')
Is this an issue with ActiveRecord not recognizing the primary key, or
an issue with how the database is setup? Everything worked fine when the
field was named "id".
Thanks in advance!
Ben
--
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.