Sha256: 3954725beffa35780bae7cfd156fa0c03b1f1a65d87c659aadd4e3055969536e

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

class AddEmailRecipientSpecs < ActiveRecord::Migration
  def self.up
    # Workaround change_column not allowing change to :null => true
    remove_column :message_recipients, :receiver_id
    remove_column :message_recipients, :receiver_type
    
    add_column :message_recipients, :receiver_id, :integer, :null => true, :default => nil, :references => nil
    add_column :message_recipients, :receiver_type, :string, :null => true, :default => nil
    add_column :message_recipients, :receiver_spec, :string, :limit => 320
  end

  def self.down
    remove_column :message_recipients, :receiver_spec
    
    change_column :message_recipients, :receiver_id, :integer, :null => false, :references => nil
    change_column :message_recipients, :receiver_type, :string, :null => false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
has_emails-0.0.1 db/migrate/003_add_email_recipient_specs.rb