Closed ppoektos closed 11 years ago
Fix pushed...
Unfortunately your fix don't work: [root@redmine rm2.3.0]# rake redmine:plugins:migrate NAME=planner VERSION=0 RAILS_ENV=production Migrating planner (Planner)... == ModPlanTasksDescr: reverting ============================================== -- remove_column(:created_at) rake aborted! An error has occurred, all later migrations canceled:
You must specify at least one column name. Example: remove_column(:people, :first_name)
I'm not expert, but maybe you need to include: def self.down drop_table :table_name end in each .rb file under redmine/planner/db/migrate
Not working for me too
I tested the whole DB migrations like this (on an old Redmine 2.0 installation):
The ModPlanTaskDescr actually has a 'up' and 'down'. It's not necessary for the other migrations since they use 'change'. This works both ways for most, but not all changes. One of the changes that is not reversible is t.change (a change in data type). Others work fine.
Probably the problem you are facing is this: You first tried to uninstall with the broken version of the migration. This basically means it runs everything in 'change' from backwards from bottom to top with the function reversed. The last thing there is 't.timestamps'. Since for the uninstall case this gets run first, the timestamps were already removed when it hit the t.change that is not reversible. Now the fixed version of the migration tries to remove the the two timestamp column (:created_at, :updated_at) and fails...So the fix in your case is to simply delete these two rows from 007_mod_plan_tasks_descr.rb:
remove_column :created_at
remove_column :updated_at
Ok, this is now fixed for real, see #14
Thanks, now it works!
Environment: Redmine version 2.3.0.stable.11670 Ruby version 1.9.3 (i686-linux) Rails version 3.2.13 Environment production Database adapter Mysql2 Redmine plugins: planner 0.4 redmine_drafts 0.2.0 redmine_fields_permissions 1.0.0 redmine_hide_estimated_hours 1.0.3 redmine_knowledgebase 2.2.0 redmine_lightbox 0.0.1 redmine_monitoring_controlling 0.1.1 redmine_timesheet_plugin 0.7.0
[root@redmine rm2.3.0]# rake redmine:plugins:migrate NAME=planner VERSION=0 RAILS_ENV=production Migrating planner (Planner)... == ModPlanTasksDescr: reverting ============================================== rake aborted! An error has occurred, all later migrations canceled:
ActiveRecord::IrreversibleMigration /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration/command_recorder.rb:42:in'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)
block in inverse' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration/command_recorder.rb:40:in
map' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration/command_recorder.rb:40:ininverse' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:401:in
block (3 levels) in migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:358:inrevert' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:400:in
block (2 levels) in migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:399:inblock in migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in
with_connection' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:389:inmigrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in
migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:720:inblock (2 levels) in migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in
call' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:inddl_transaction' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:719:in
block in migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:ineach' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in
migrate' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:574:indown' /usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.13/lib/active_record/migration.rb:555:in
migrate' /var/www/rm2.3.0/lib/redmine/plugin.rb:453:inmigrate_plugin' /var/www/rm2.3.0/lib/redmine/plugin.rb:425:in
migrate' /var/www/rm2.3.0/lib/redmine/plugin.rb:436:inmigrate' /var/www/rm2.3.0/lib/tasks/redmine.rake:74:in
block (3 levels) in <top (required)>' /usr/local/rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:ineval' /usr/local/rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in