diff --git a/db/migrate/20110905134638_link_errs_to_problems.rb b/db/migrate/20110905134638_link_errs_to_problems.rb index c142df0..3c62147 100644 --- a/db/migrate/20110905134638_link_errs_to_problems.rb +++ b/db/migrate/20110905134638_link_errs_to_problems.rb @@ -1,14 +1,15 @@ class LinkErrsToProblems < Mongoid::Migration def self.up + puts "== Migrating from Errs to Problems..." - # Copy err.klass to notice.klass + puts "==== Copy err.klass to notice.klass..." Notice.all.each do |notice| if notice.err && (klass = notice.err['klass']) notice.update_attribute(:klass, klass) end end - # Create a Problem for each Err + puts "==== Create a Problem for each Err..." Err.all.each do |err| if err['app_id'] && app = App.where(:_id => err['app_id']).first err.problem = app.problems.create @@ -16,7 +17,9 @@ class LinkErrsToProblems < Mongoid::Migration end end + puts "==== Updating problem cached attributes..." Rake::Task["errbit:db:update_problem_attrs"].invoke + puts "==== Updating notice counts..." Rake::Task["errbit:db:update_notices_count"].invoke end -- libgit2 0.21.2