Project

General

Profile

Error with db:migrate from 0.7.1 to 0.8.4

Added by Chris Williams over 15 years ago

I am trying to migrate a postgres database from redmine 0.7.1 to 0.8.4 using jruby. Here is the error I am seeing.

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== 93 AddWikiPagesProtected: migrating ========================================
-- add_column(:wiki_pages, :protected, :boolean, {:default=>false, :null=>false})
rake aborted!
ActiveRecord::ActiveRecordError: ERROR: column "protected" of relation "wiki_pages" already exists: ALTER TABLE "wiki_pages" ADD "protected" bool
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log'/net/snv44003/data1/packages/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:563:in `execute'
/net/snv44003/data1/packages/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/jdbc_adapter/jdbc_postgre.rb:421:in `add_column'
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/migration.rb:346:in `method_missing'
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/migration.rb:326:in `say_with_time'
/net/snv44003/data1/packages/jruby-1.3.1/lib/ruby/1.8/benchmark.rb:293:in `measure'
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/migration.rb:326:in `say_with_time'
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/migration.rb:342:in `method_missing'
db/migrate//093_add_wiki_pages_protected.rb:3:in `up'
/mirror1/redmine-0.8.4/vendor/rails/activerecord/lib/active_record/migration.rb:280:in `migrate'
/net/snv44003/data1/packages/jruby-1.3.1/lib/ruby/1.8/benchmark.rb:293:in `measure'

I looked in the 0.7.1 db/migrate directory and 092_change_changes_from_revision_to_string.rb is the last one listed. I am going to continue to poke around but any suggestions on a workaround?

Thanks
Chris


Replies (1)

RE: Error with db:migrate from 0.7.1 to 0.8.4 - Added by Chris Williams over 15 years ago

Well, I don't know what happened but I commented out what was being done in the 093 migration and the rest ran fine. It almost seemed like 093 ran the first time and something failed but didn't update the migration version or rollback the update. Either way, I am up and running.

    (1-1/1)