                         :fields str/upper-case}}))
 
 (defn migrate
-  "Migrate the database :up or :down."
+  "Migrate the database `:up` or `:down.`"
   [direction]
   (let [conn (jdbc/get-connection {:subprotocol "h2"
                                    :subname db-file})]

(defn del
  "Wrapper around `korma.core/delete` that makes it easier to delete a row given a single PK value.
   Returns a `204 (No Content)` response dictionary."
  [entity & kwargs]
  (delete entity (where (apply assoc {} kwargs)))
  {:status 204
   :body nil})


   `(upd User 123 :is_active false)` -> updates user with id=123, setting is_active=false

   Returns true if update modified rows, false otherwise."
  [entity entity-id & {:as kwargs}]
  (let [kwargs (->> kwargs
                    (pre-update entity))]
    (-> (update entity (set-fields kwargs) (where {:id entity-id}))
        (> 0))))
