20170209184350_add_reply_to_statuses.rb 262 B

12345678910
  1. class AddReplyToStatuses < ActiveRecord::Migration[5.0]
  2. def up
  3. add_column :statuses, :reply, :boolean, nil: false, default: false
  4. Status.update_all('reply = (in_reply_to_id IS NOT NULL)')
  5. end
  6. def down
  7. remove_column :statuses, :reply
  8. end
  9. end