This repository has been archived by the owner on Jan 27, 2020. It is now read-only.
forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mastodon#755 from pixiv/more-faster-index-on-notif…
…ications more faster index on notifications table (mastodon#6108)
- Loading branch information
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
db/migrate/20171226094803_more_faster_index_on_notifications.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class MoreFasterIndexOnNotifications < ActiveRecord::Migration[5.1] | ||
def change | ||
commit_db_transaction | ||
add_index :notifications, [:account_id, :id], order: { id: :desc }, algorithm: :concurrently | ||
remove_index :notifications, name: :index_notifications_on_id_and_account_id_and_activity_type | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters