db error on upgrade 1.0.2 -> 1.4.4
Added by Leonardo Carneiro over 12 years ago
Hi everyone,
I following the upgrade guide, but i'm facing an error while running the database upgrade.
== ChangeJournalDetailsValuesToText: migrating =============================== -- change_column(:journal_details, :old_value, :text) rake aborted! An error has occurred, this and all later migrations canceled: PG::Error: ERROR: cannot alter type of a column used by a view or rule DETAIL: rule rlinsertptbrdetail on table journal_details depends on column "old_value" : ALTER TABLE "journal_details" ALTER COLUMN "old_value" TYPE text /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/postgresql_adapter.rb:824:in `change_column' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:352:in `send' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:352:in `method_missing' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `say_with_time' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `say_with_time' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:348:in `method_missing' ./db/migrate//20110227125750_change_journal_details_values_to_text.rb:3:in `up_without_benchmarks' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `send' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `__send__' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `migrate' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:491:in `migrate' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:565:in `call' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:565:in `ddl_transaction' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:182:in `transaction' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:565:in `ddl_transaction' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:490:in `migrate' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `each' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `migrate' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:401:in `up' /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:383:in `migrate' /var/lib/gems/1.8/gems/rails-2.3.14/lib/tasks/databases.rake:112 /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' /var/lib/gems/1.8/gems/rake-0.9.2.2/bin/rake:33 /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19 Tasks: TOP => db:migrate
i don't know the insides of the redmine db, so i'm not confident if i should drop the view/rule or not. any advises?
tks in advance
Replies (1)
RE: db error on upgrade 1.0.2 -> 1.4.4
-
Added by Leonardo Carneiro over 12 years ago
aditional info:
Going from:
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] Rails 2.1.0 Debian Lenny Apache2+modpassenger /opt/redmine$ RAILS_ENV=production script/about About your application's environment Ruby version 1.8.7 (i486-linux) RubyGems version 1.3.4 Rack version 1.0 Rails version 2.3.5 Active Record version 2.3.5 Active Resource version 2.3.5 Action Mailer version 2.3.5 Active Support version 2.3.5 Edge Rails revision unknown Application root /opt/redmine-1.0.2 Environment production Database adapter postgresql Database schema version 20100819172912 About your Redmine plugins Redmine Veltrac plugin 0.0.1 Redmine Schedules plugin 0.5.0.1 Redmine Scrum Sprints plugin 0.1.3 Redmine Charts 0.1.0
To:
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] Rails 2.3.14 Ubuntu Server 12.04 32bit Apache2+modpassenger /opt/redmine-1.4.4# RAILS_ENV=production script/about NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /var/lib/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. About your application's environment Ruby version 1.8.7 (i686-linux) RubyGems version 1.8.15 Rack version 1.1.3 Rails version 2.3.14 Active Record version 2.3.14 Active Resource version 2.3.14 Action Mailer version 2.3.14 Active Support version 2.3.14 Application root /opt/redmine-1.4.4 Environment production Database adapter postgresql Database schema version 20110226120132 About your Redmine plugins Redmine Veltrac plugin 0.0.1 Redmine Charts 0.1.0 Redmine Schedules plugin 0.5.0.1