20170209184350_add_reply_to_statuses.rb 302 B

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