           updated-entry (assoc entry :author updated-authors)]
       (let [updated-entry (update-entry conn updated-entry original-entry ts)]
         ;; copy current version to versions table, increment revision uuid
-        (create-version conn updated-entry original-entry)
-        updated-entry))))
+        (create-version conn updated-entry original-entry)))))
 
 (defn upsert-entry!
   "

          updated-authors (conj authors (assoc publisher :updated-at ts))
          entry-update (assoc merged-entry :author updated-authors)]
      (schema/validate common/Entry entry-update)
      (let [updated-entry (db-common/update-resource conn table-name primary-key original-entry entry-update ts)]
        ;; copy current version to versions table, increment revision uuid
        (create-version conn updated-entry entry-update)
        ;; Delete the draft entry's interactions
        (db-common/delete-resource conn common/interaction-table-name :resource-uuid uuid)
        updated-entry)))))

(schema/defn ^:always-validate delete-entry!
  "Given the UUID of the entry, delete the entry and all its interactions. Return `true` on success."

                                               "-v" revision-id))
                     (assoc :revision-date ts)
                     (assoc :revision-author (first (:author original-entry))))]
    (let [updated-entry (if-not (:deleted original-entry)
                          (update-entry conn
                            (assoc updated-entry :revision-id revision-id-new)
                            updated-entry
                            ts)
                          updated-entry)]
      (db-common/create-resource conn versions-table-name revision ts)
      updated-entry)))

(defn delete-versions [conn entry]
  (doseq [version (range (inc (:revision-id entry)))]
