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

This commit is contained in:
Anton Argirov 2015-06-23 13:59:14 +06:00
parent a781bee2c8
commit f25070e589
4 changed files with 4 additions and 3 deletions

View File

@ -90,6 +90,7 @@ class CustomWorkflow < ActiveRecord::Base
end end
def validate_syntax def validate_syntax
return unless respond_to? :observable
case observable case observable
when 'shared' when 'shared'
CustomWorkflow.run_shared_code(self) CustomWorkflow.run_shared_code(self)

View File

@ -8,6 +8,5 @@ class AlterCustomWorkflows < ActiveRecord::Migration
end end
def self.down def self.down
raise ActiveRecord::IrreversibleMigration
end end
end end

View File

@ -4,6 +4,5 @@ class ChangeCustomWorkflowsDescriptionType < ActiveRecord::Migration
end end
def self.down def self.down
change_column :custom_workflows, :description, :string, :null => false, :default => ''
end end
end end

View File

@ -1,5 +1,7 @@
class SetPositionFieldNullable < ActiveRecord::Migration class SetPositionFieldNullable < ActiveRecord::Migration
def change def up
change_column :custom_workflows, :position, :integer, :null => true change_column :custom_workflows, :position, :integer, :null => true
end end
def down
end
end end