Metal
Metal

Reputation: 205

Rails 3 migration error

Whenever I create and run a new migration, my earliest migration automatically starts executing and gives me the following error:- "rake aborted! An error has occurred, all later migrations canceled: Mysql2::Error: Table 'xyz' already exists" Due to the this error my rake db:migrate does not run and rather I have to use rake db:migrate:up VERSION=123xyz for my new migration. What shall I do to remove this error , so that my previous miration doesn't run everytime.

Upvotes: 1

Views: 478

Answers (2)

Matthew
Matthew

Reputation: 2135

Try checking if your Gemfile is updated. See Listing 1.18 (scroll above to see the same a similar error message the author addresses):

http://ruby.railstutorial.org/chapters/beginning#code:gemfile_sqlite_heroku

Inside the GemFile:

source 'http://rubygems.org'

gem 'rails', '3.0.5'

gem 'sqlite3-ruby', '1.3.2', :group => :development

Upvotes: 0

Sergey K
Sergey K

Reputation: 5107

drop this table manually in the mysql console

Upvotes: 1

Related Questions