Commit 8696af0ad51d36822d72b2831f3b3f1920ba7f98
1 parent
ccdd2c52
Exists in
master
and in
1 other branch
don't break when running all migrations if using a newer Errbit
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
db/migrate/20110422152027_move_notices_to_separate_collection.rb
| ... | ... | @@ -5,6 +5,10 @@ class MoveNoticesToSeparateCollection < Mongoid::Migration |
| 5 | 5 | errs = mongo_db.collection("errs").find({ }, :fields => ["notices"]) |
| 6 | 6 | errs.each do |err| |
| 7 | 7 | next unless err['notices'] |
| 8 | + | |
| 9 | + # This Err was created after the Problem->Err->Notice redesign | |
| 10 | + next if err['app_id'].nil? or err['problem_id'] | |
| 11 | + | |
| 8 | 12 | e = Err.find(err['_id']) |
| 9 | 13 | # disable email notifications |
| 10 | 14 | old_notify = e.app.notify_on_errs? | ... | ... |