 (defn- delete-temp-index [conn]
   (println (m/remove-index conn entry/table-name temp-index-name)))
 
-(defn- entries-for-org [conn org-uuid]
-  (db-common/read-resources conn entry/table-name temp-index-name [[org-uuid :published false]] [:uuid :follow-ups :bookmarks]))
+(defn- unique-entries-for-org [conn org-uuid]
+  (let [all-entries (db-common/read-resources conn entry/table-name temp-index-name
+                     [[org-uuid :published false]] [:uuid :follow-ups :bookmarks])
+        all-uuids (vec (set (map :uuid all-entries)))
+        unique-entries (map (fn [entry-uuid]
+                              (first (filter #(= (:uuid %) entry-uuid) all-entries)))
+                        all-uuids)]
+    (println "   count all-entries" (count all-entries))
+    (println "   count all-uuids" (count all-uuids))
+    (println "   count unique-entries" (count unique-entries))
+    unique-entries))
 
 (defn index-of
   "Given a collection and a function return the index that make the function truely."

  To actually update the entries:

  lein run -m oc.storage.util.migrate-bookmarks -f

  Use -s/--self-only to create bookmarks only for self created follow-ups."


                                                    (= (-> % :assignee :user-id) (-> % :author :user-id)))))
                                    (:assignee %))
                            follow-ups))
        updated-bookmarks (vec (clojure.set/union (set (map :user-id new-bookmarks)) (:bookmarks e)))
        updated-follow-ups (when complete-follow-ups?
                             (mapv #(if (and (not (:completed? %))
                                               (or (not self-only?)
