After posting, I looked again, and I think I see your problem.

On Oct 11, 4:33 pm, Al Rowan <[email protected]> wrote:
[...]
> migration for schemes_works
>
> class CreateSchemesWorks < ActiveRecord::Migration
> def self.up
>   create_table :schemes_works, :id => false do |t|
>     t.references :scheme
>     t.references :work
> end
>
> THE ERROR
[...]
> ActiveRecord::StatementInvalid: SQLite3::SQLException: near ")": syntax 
> error: INSERT INTO "schemes_works" () VALUES ()

Notice the empty first pair of parentheses there.  The field names
should go there (that is, the query should look like
INSERT INTO "schemes_works" (scheme_id, work_id) VALUES (21, 5)
), so presumably Rails doesn't realize there are any fields in that
table.  Now the question is *why*.

Take a look at the schemes_works table in your DB.  Does it have
scheme_id and work_id fields?

Take a look at your db/schema.rb file, specifically the part
describing the schemes_works table.  Does it have those fields?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
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.

Reply via email to