Sha256: f57c5ea0fec7c5b0f686ed8fed2890db09975d5b23eee770c062fd675d8643ec
Contents?: true
Size: 376 Bytes
Versions: 31
Compression:
Stored size: 376 Bytes
Contents
class AddTypeToMessages < ActiveRecord::Migration[5.1] def up add_column :messages, :type, :string Message.all.each do |message| if message.trigger.present? message.update_attribute(:type, 'automated') else message.update_attribute(:type, 'bulk') end end end def down remove_column :messages, :type, :string end end
Version data entries
31 entries across 31 versions & 1 rubygems