Gab-Social/db/migrate/20201203213059_backfill_add_unread_count_to_chat_conversation_accounts.rb

10 lines
257 B
Ruby
Raw Normal View History

2020-12-03 22:13:11 +00:00
class BackfillAddUnreadCountToChatConversationAccounts < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def change
ChatConversationAccount.in_batches do |relation|
relation.update_all unread_count: 0
sleep(0.1)
end
end
end