class AddTypeToLogTable < ActiveRecord::Migration
def self.up
- begin
- remove_column 'logs', 'payload_field'
- add_column 'logs', 'log_type', :string, :limit => 50
- add_column 'logs', 'log_message', :string
- end
+ remove_column 'logs', 'payload_field'
+ add_column 'logs', 'log_type', :string, :limit => 50
+ add_column 'logs', 'log_message', :string
end
end
class RenameRulesParentIdToTemplateId < ActiveRecord::Migration
def self.up
- begin
- rename_column 'rules', 'parent_id', 'template_id'
- end
+ rename_column 'rules', 'parent_id', 'template_id'
end
end
end
def self.up
- begin
- add_column 'rules', 'is_template', :boolean, :null => false, :default => false
- Rule.reset_column_information
- Rule.all.each do |r|
- r.is_template = r.cardinality == 'MULTIPLE'
- r.save!
- end
- remove_column 'rules', 'cardinality'
+ add_column 'rules', 'is_template', :boolean, :null => false, :default => false
+ Rule.reset_column_information
+ Rule.all.each do |r|
+ r.is_template = r.cardinality == 'MULTIPLE'
+ r.save!
end
+ remove_column 'rules', 'cardinality'
end
end