    33 add-certname-id-to-certnames
    34 add-certname-id-to-resource-events
    ;; This dummy migration ensures that even databases that were up to
-   ;; date when the "vacuum analyze" code was added to run-migrations
-   ;; will still analyze their existing databases.
+   ;; date when the analyze-tables code was added will still analyze
+   ;; their existing databases.
    35 (fn [] true)
    36 rename-environments-name-to-environment
    37 add-jsonb-columns-for-metrics-and-logs

    (apply jdbc/do-commands-outside-txn
           (map #(str "vacuum analyze " %) tables))))

(defn run-migrations
  []
  (require-valid-schema)
  (let [small-tables (set ["value_types" "report_statuses"])
        tables (jdbc/with-db-transaction []
                 (when-let [pending (seq (pending-migrations))]
                   (->> pending
                        (map (fn [[version migration]]

  version, etc. has already been validated."
  []
  (try
    (let [tables-to-analyze (run-migrations)]
      (analyze-tables tables-to-analyze)
      (indexes!)
      (not (empty? tables-to-analyze)))
    (catch java.sql.SQLException e
      (log/error e (trs "Caught SQLException during migration"))
      (loop [ex (.getNextException e)]
