about summary refs log blame commit diff
path: root/db/migrate/20170209184350_add_reply_to_statuses.rb
blob: c5074728bf1f8bee38ced0fce5b3353dcdfd0509 (plain) (tree)
1
2
3
4
5
6
7
8
9
10








                                                                      
class AddReplyToStatuses < ActiveRecord::Migration[5.0]
  def up
    add_column :statuses, :reply, :boolean, nil: false, default: false
    Status.update_all('reply = (in_reply_to_id IS NOT NULL)')
  end

  def down
    remove_column :statuses, :reply
  end
end