Commit 610f0dc52643c5e16108753714e4a0de72d4fa3c

Authored by Marcin Ciunelis
1 parent 24e4fe69
Exists in master and in 1 other branch production

verbose migration

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
... ...