Ruby on Rails Saturday, July 31, 2010

Check to see if you have duplicate code in any of your migrations to
create this table:

> SQLite3::SQLException: table "sessions" already exists: CREATE TABLE
> "sessions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "session_id"
> varchar(255) NOT NULL, "data" text, "created_at" datetime, "updated_at"
> datetime)

This can easily happen if you have code to create all your tables in
the main CreateDatabase migration file, then run script/generate to
generate scaffolding or a model for an existing table. The generator
script will create a new migration with table creation code, causing
rake to choke the next time you do a migration.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment