Commit 610f0dc52643c5e16108753714e4a0de72d4fa3c
1 parent
24e4fe69
Exists in
master
and in
1 other branch
verbose migration
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
db/migrate/20121003223358_extract_backtraces.rb
| 1 | 1 | class ExtractBacktraces < Mongoid::Migration |
| 2 | 2 | def self.up |
| 3 | + say "Please it could take long time (hours if you have many Notices)" | |
| 3 | 4 | Notice.unscoped.all.each do |notice| |
| 4 | 5 | backtrace = Backtrace.find_or_create(:raw => notice['backtrace']) |
| 5 | 6 | notice.backtrace = backtrace |
| 6 | 7 | notice['backtrace'] = nil |
| 7 | 8 | notice.save! |
| 8 | 9 | end |
| 10 | + say "run `db.repairDatabase()` (in mongodb console) to recover deleted space" | |
| 9 | 11 | end |
| 10 | 12 | |
| 11 | 13 | def self.down | ... | ... |