20131011164400_add_spam_to_task.rb 275 Bytes
class AddSpamToTask < ActiveRecord::Migration
  def self.up
    change_table :tasks do |t|
      t.boolean :spam, :default => false
    end
    Task.update_all ["spam = ?", false]
    add_index :tasks, [:spam]
  end

  def self.down
    remove_column :tasks, :spam
  end
end