From 30f98aec3c56d74a21b52d7edaaf894f2e7bb793 Mon Sep 17 00:00:00 2001
From: Raphael <raphael@joindiaspora.com>
Date: Mon, 10 Jan 2011 17:07:16 -0800
Subject: [PATCH] Set notification target type after importing

---
 lib/data_conversion/import_to_mysql.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/data_conversion/import_to_mysql.rb b/lib/data_conversion/import_to_mysql.rb
index 3eff0aaa3b..6e6725ec55 100644
--- a/lib/data_conversion/import_to_mysql.rb
+++ b/lib/data_conversion/import_to_mysql.rb
@@ -428,6 +428,12 @@ module DataConversion
         SET #{boolean_set("unread")};
       SQL
       log "Finished. Imported #{Mongo::Notification.count} notifications."
+      {"new_request" => "Request",
+      "request_accepted" => "Contact",
+      "comment_on_post" => "Comment",
+      "also_commented" => "Comment"}.each_pair do |key, value|
+        Mongo::Notification.where(:action => key).update_all(:target_type => value)
+      end
     end
     def import_raw_people
       log "Loading people file..."
-- 
GitLab