-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing STI and reference indices on mailboxer_conversation_opt…
…_outs, mailboxer_notifications, and mailboxer_receipts. Please note, that "functional" indices (e.g., read/unread messages, etc.) should be added in the future as well.
- Loading branch information
Leonid Beder
committed
Aug 16, 2014
1 parent
6e79c17
commit 2564da6
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
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,19 @@ | ||
class AddMissingIndices < ActiveRecord::Migration | ||
def change | ||
# We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63 | ||
# characters limitation. | ||
add_index :mailboxer_conversation_opt_outs, [:unsubscriber_id, :unsubscriber_type], | ||
name: 'index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type' | ||
add_index :mailboxer_conversation_opt_outs, :conversation_id | ||
|
||
add_index :mailboxer_notifications, :type | ||
add_index :mailboxer_notifications, [:sender_id, :sender_type] | ||
|
||
# We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63 | ||
# characters limitation. | ||
add_index :mailboxer_notifications, [:notified_object_id, :notified_object_type], | ||
name: 'index_mailboxer_notifications_on_notified_object_id_and_type' | ||
|
||
add_index :mailboxer_receipts, [:receiver_id, :receiver_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