discourse/db/migrate/20160215075528_add_unread_p...

9 lines
325 B
Ruby

# 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, [:user_id, :id], unique: true, where: 'notification_type = 6 AND NOT read'
end
end