0
0
Fork 0

Add experimental server-side notification grouping (#29889)

This commit is contained in:
Claire 2024-06-03 10:35:59 +02:00 committed by GitHub
parent db49b0e5e9
commit 974335e414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 618 additions and 0 deletions

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddGroupKeyToNotifications < ActiveRecord::Migration[7.1]
def change
add_column :notifications, :group_key, :string
end
end

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class AddIndexNotificationsOnAccountIdAndGroupKey < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :notifications, [:account_id, :group_key], algorithm: :concurrently, where: 'group_key IS NOT NULL'
end
end

View file

@ -724,6 +724,8 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_22_041528) do
t.bigint "from_account_id", null: false
t.string "type"
t.boolean "filtered", default: false, null: false
t.string "group_key"
t.index ["account_id", "group_key"], name: "index_notifications_on_account_id_and_group_key", where: "(group_key IS NOT NULL)"
t.index ["account_id", "id", "type"], name: "index_notifications_on_account_id_and_id_and_type", order: { id: :desc }
t.index ["account_id", "id", "type"], name: "index_notifications_on_filtered", order: { id: :desc }, where: "(filtered = false)"
t.index ["activity_id", "activity_type"], name: "index_notifications_on_activity_id_and_activity_type"