Commit 543d62bd329b36976d30eda8a537b4a309172346
Committed by
Victor Costa
1 parent
9a1c00d4
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Speed up role assignments fetch
(ActionItem3197)
Showing
1 changed file
with
15 additions
and
0 deletions
Show diff stats
db/migrate/20140708123314_index_role_assignments_filtered_fields.rb
0 → 100644
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +class IndexRoleAssignmentsFilteredFields < ActiveRecord::Migration | |
| 2 | + | |
| 3 | + def self.up | |
| 4 | + add_index :role_assignments, [:accessor_id, :accessor_type] | |
| 5 | + add_index :role_assignments, [:accessor_id, :accessor_type, :role_id] | |
| 6 | + add_index :role_assignments, [:resource_id, :resource_type] | |
| 7 | + add_index :role_assignments, [:resource_id, :resource_type, :role_id] | |
| 8 | + add_index :role_assignments, [:accessor_id, :accessor_type, :resource_id, :resource_type] | |
| 9 | + add_index :profiles, [:type] | |
| 10 | + add_index :profiles, [:visible] | |
| 11 | + add_index :profiles, [:enabled] | |
| 12 | + add_index :profiles, [:validated] | |
| 13 | + end | |
| 14 | + | |
| 15 | +end | ... | ... |