Progress with DMs

Progress with DMs
This commit is contained in:
mgabdev
2020-12-03 17:13:11 -05:00
parent a129b3ce3b
commit 137a36b810
53 changed files with 539 additions and 182 deletions

View File

@@ -0,0 +1,10 @@
class AddUnreadCountToChatConversationAccounts < ActiveRecord::Migration[5.2]
def up
add_column :chat_conversation_accounts, :unread_count, :bigint
change_column_default :chat_conversation_accounts, :unread_count, 0
end
def down
remove_column :chat_conversation_accounts, :unread_count
end
end

View File

@@ -0,0 +1,5 @@
class RemoveIsUnreadFromChatConversationAccounts < ActiveRecord::Migration[5.2]
def change
safety_assured { remove_column :chat_conversation_accounts, :is_unread }
end
end

View File

@@ -0,0 +1,5 @@
class AddExpiresAtToChatMessages < ActiveRecord::Migration[5.2]
def change
add_column :chat_messages, :expires_at, :datetime, null: true, default: nil
end
end

View File

@@ -0,0 +1,10 @@
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

View File

@@ -0,0 +1,5 @@
class AddUnreadCountToChatConversationAccountsNotNull < ActiveRecord::Migration[5.2]
def change
change_column_null :chat_conversation_accounts, :unread_count, false
end
end

View File

@@ -0,0 +1,5 @@
class AddChatMessageExpirationPolicyToChatConversationAccounts < ActiveRecord::Migration[5.2]
def change
add_column :chat_conversation_accounts, :chat_message_expiration_policy, :string, null: true, default: nil
end
end