0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/db/migrate/20160215075528_add_unread_pm_index_to_notifications.rb
2023-01-09 11:59:41 +00:00

11 lines
366 B
Ruby
Vendored

# frozen_string_literal: true
class AddUnreadPmIndexToNotifications < ActiveRecord::Migration[4.2]
def change
# create index idxtmp on notifications(user_id, id) where notification_type = 6 AND NOT read
add_index :notifications,
%i[user_id id],
unique: true,
where: "notification_type = 6 AND NOT read"
end
end