Commit 64dd2e0fd62f8f2ca074dc351964a571fb807f69
1 parent
a2571ba9
Exists in
master
and in
28 other branches
Creating indexes before removing records
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
db/migrate/20100928000952_aggressive_indexing_strategy2.rb
| 1 | 1 | class AggressiveIndexingStrategy2 < ActiveRecord::Migration |
| 2 | 2 | def self.up |
| 3 | + add_index(:action_tracker_notifications, :profile_id) | |
| 4 | + add_index(:action_tracker_notifications, :action_tracker_id) | |
| 3 | 5 | |
| 4 | 6 | say 'Removing duplicate notification records ...' |
| 5 | 7 | buffer = '' |
| ... | ... | @@ -29,8 +31,6 @@ class AggressiveIndexingStrategy2 < ActiveRecord::Migration |
| 29 | 31 | execute buffer |
| 30 | 32 | end |
| 31 | 33 | |
| 32 | - add_index(:action_tracker_notifications, :profile_id) | |
| 33 | - add_index(:action_tracker_notifications, :action_tracker_id) | |
| 34 | 34 | add_index(:action_tracker_notifications, [:profile_id, :action_tracker_id], :unique => true) |
| 35 | 35 | end |
| 36 | 36 | ... | ... |