20181018205649_add_unread_to_account_conversations.rb 514 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. require Rails.root.join('lib', 'mastodon', 'migration_helpers')
  3. class AddUnreadToAccountConversations < ActiveRecord::Migration[5.2]
  4. include Mastodon::MigrationHelpers
  5. disable_ddl_transaction!
  6. def up
  7. safety_assured do
  8. add_column_with_default(
  9. :account_conversations,
  10. :unread,
  11. :boolean,
  12. allow_null: false,
  13. default: false
  14. )
  15. end
  16. end
  17. def down
  18. remove_column :account_conversations, :unread, :boolean
  19. end
  20. end