Why am I getting duplicate version error using db:migrate VERSION=XXX?
I'm working with an application that was upgraded from Ruby 1.8.6 to Ruby 1.8.7. I created a number of migration scripts named as 999_whatever_function.rb
, ordered sequentially. The whole set from previous runs have items from 001
until 430
, and I added items up to 450
. When I try to use
rake db:migrate VERSION=450
It aborts with this error
C:\Ruby\projects\db_upgrade>rake db:migrate VERSION=450 --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
**Mu开发者_开发问答ltiple migrations have the version number 3500**
c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:507:in `migrations'
I have no duplicate numbering on the scripts but I'm wondering if the version 1.8.7 requires a different type of VERSION notation (YYYYMMDDTime)?
I see that you say there are no duplicate migrations, but that's what would trigger this error. Double-check the prefixes of the migrations in db/migrate. Are there two that begin with 3500?
Also, you are conflating Ruby and Rails. Ruby is at version 1.8.7, not Rails. It looks like you are running Rails 2.3.4.
精彩评论