-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impossible to uninstall, the database won't downgrade #53
Comments
Hi Rémi, I just pushed the fix so it does not error out completely when rolling back -- you can either pull from the develop branch, or you can comment out (add a # at the beginning of the line) the following line in db/migrate/004_set_default_modifier_for_existing_monthly_issues.rb and db/migrate/002_standardize_recurrence_units_nonlocalized.rb within the plugin's directory: raise ActiveRecord::IrreversibleMigration These migrations are not reversible, but neither do they prevent you from removing the plugin. |
Hello, now I go further, but still stopped by this: Migrating recurring_tasks (Recurring Tasks (Issues))... ActiveRecord::IrreversibleMigration/var/lib/gems/1.8/gems/activerecord-3.2.17/lib/active_record/migration/command_recorder.rb:42:in Thanks,Rémi |
Hi Remi, I'm not seeing any reference to the plugin in the most recent error list. Can you run the migration with the --trace flag and post the results? The current version shouldn't have any issues reverting the migrations. Do you still have a recurring_tasks table in your database? If not, this particular migration might have failed because the table it is trying to modify has already been dropped. |
I guest the problem is the migration scheme defines change for adding the interval_modifier, and migration cannot remove the column when uninstall. So I modified the file class AddIntervalModifierField < ActiveRecord::Migration def self.down end Then I can uninstall |
I leave this comment for archive purposes (Google, crawl it! :D ): I wanted to uninstall the plugin (v1.3.0) the usual way ( I got an error: Migrating recurring_tasks (Recurring Tasks (Issues))...
== StandardizeRecurrenceUnitsNonlocalized: reverting =========================
rake aborted!
An error has occurred, all later migrations canceled:
ActiveRecord::IrreversibleMigration/plugins/recurring_tasks/db/migrate/002_standardize_recurrence_units_nonlocalized.rb:28:in 'down'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in 'block (2 levels) in migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:410:in 'block in migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in 'with_connection'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:389:in 'migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:528:in 'migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:720:in 'block (2 levels) in migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in 'call'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:777:in 'ddl_transaction'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:719:in 'block in migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in 'each'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:700:in 'migrate'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:574:in 'down'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.19/lib/active_record/migration.rb:555:in 'migrate'
/lib/redmine/plugin.rb:452:in 'migrate_plugin'
/lib/redmine/plugin.rb:424:in 'migrate'
/lib/redmine/plugin.rb:435:in 'migrate'
/lib/tasks/redmine.rake:126:in 'block (3 levels) in <top (required)>'
/lib/tasks/redmine.rake:52:in 'block (2 levels) in <top (required)>'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in 'eval'
/home/redmine/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in '<main>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace) After updating to v1.5.0 ( So if you can not uninstall, update it and try again :) |
Hi,
while trying to uninstall the plugin as per the docs, I get an error that seems to indicate that the database can't downgrade:
rake --trace redmine:plugins:migrate NAME=recurring_tasks VERSION=0 RAILS_ENV=production
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
Migrating recurring_tasks (Recurring Tasks (Issues))...
== SetDefaultModifierForExistingMonthlyIssues: reverting =====================
rake aborted!
An error has occurred, this and all later migrations canceled:
ActiveRecord::IrreversibleMigration/usr/local/share/redmine-2.5.0/plugins/recurring_tasks/db/migrate/004_set_default_modifier_for_existing_monthly_issues.rb:21:in `down'
......
I don't understand all of it, but reading the file seems to indicate that the database modifications cannot be reverted. If this plugin is really impossible to remove, it should at the very least say so in the docs, and better print a big fat warning before it attempts to modifiy the database... Is there another way to get back ?
Thanks for your work,
Rémi
The text was updated successfully, but these errors were encountered: