From f25070e589cde6e741a66c94eb6d05444eec2b4d Mon Sep 17 00:00:00 2001 From: Anton Argirov Date: Tue, 23 Jun 2015 13:59:14 +0600 Subject: [PATCH] Fixed migrations, making all them reversible, so it's possible to uninstall plugin now by rake redmine:plugins:migrate NAME=redmine_custom_workflows VERSION=0 --- app/models/custom_workflow.rb | 1 + db/migrate/20120601054047_alter_custom_workflows.rb | 1 - ...20120628060102_change_custom_workflows_description_type.rb | 1 - db/migrate/20150522134437_set_position_field_nullable.rb | 4 +++- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/custom_workflow.rb b/app/models/custom_workflow.rb index a158137..1c1d6ba 100644 --- a/app/models/custom_workflow.rb +++ b/app/models/custom_workflow.rb @@ -90,6 +90,7 @@ class CustomWorkflow < ActiveRecord::Base end def validate_syntax + return unless respond_to? :observable case observable when 'shared' CustomWorkflow.run_shared_code(self) diff --git a/db/migrate/20120601054047_alter_custom_workflows.rb b/db/migrate/20120601054047_alter_custom_workflows.rb index 84fdf31..d67ef21 100644 --- a/db/migrate/20120601054047_alter_custom_workflows.rb +++ b/db/migrate/20120601054047_alter_custom_workflows.rb @@ -8,6 +8,5 @@ class AlterCustomWorkflows < ActiveRecord::Migration end def self.down - raise ActiveRecord::IrreversibleMigration end end diff --git a/db/migrate/20120628060102_change_custom_workflows_description_type.rb b/db/migrate/20120628060102_change_custom_workflows_description_type.rb index 1694f56..262678c 100644 --- a/db/migrate/20120628060102_change_custom_workflows_description_type.rb +++ b/db/migrate/20120628060102_change_custom_workflows_description_type.rb @@ -4,6 +4,5 @@ class ChangeCustomWorkflowsDescriptionType < ActiveRecord::Migration end def self.down - change_column :custom_workflows, :description, :string, :null => false, :default => '' end end diff --git a/db/migrate/20150522134437_set_position_field_nullable.rb b/db/migrate/20150522134437_set_position_field_nullable.rb index 4cc75c7..95b73fc 100644 --- a/db/migrate/20150522134437_set_position_field_nullable.rb +++ b/db/migrate/20150522134437_set_position_field_nullable.rb @@ -1,5 +1,7 @@ class SetPositionFieldNullable < ActiveRecord::Migration - def change + def up change_column :custom_workflows, :position, :integer, :null => true end + def down + end end