cirandas.net

ref: master

db/migrate/20131011164400_add_spam_to_task.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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