diff --git a/db/migrate/20121003223358_extract_backtraces.rb b/db/migrate/20121003223358_extract_backtraces.rb index b6ab319..388f905 100644 --- a/db/migrate/20121003223358_extract_backtraces.rb +++ b/db/migrate/20121003223358_extract_backtraces.rb @@ -2,6 +2,7 @@ class ExtractBacktraces < Mongoid::Migration def self.up say "It could take long time (hours if you have many Notices)" Notice.unscoped.all.each do |notice| + next if notice.backtrace.present? || notice['backtrace'].nil? backtrace = Backtrace.find_or_create(:raw => notice['backtrace'] || []) notice.backtrace = backtrace notice['backtrace'] = nil @@ -12,4 +13,4 @@ class ExtractBacktraces < Mongoid::Migration def self.down end -end +end \ No newline at end of file -- libgit2 0.21.2