mirror of
https://github.com/discourse/discourse.git
synced 2025-09-08 12:06:51 +08:00
PERF: speed up counting of unread notifications
This commit is contained in:
parent
e6f73a1c80
commit
1eeed5fed2
1 changed files with 5 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUnreadNotificationsIndex < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index :notifications, [:user_id, :notification_type], where: 'not read', name: 'idx_notifications_speedup_unread_count'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue