 
   (sql/create-table :schema_migrations
                     ["version" "INT" "NOT NULL" "PRIMARY KEY"]
-                    ["time" "DATETIME" "NOT NULL"])
+                    ["time" "TIMESTAMP" "NOT NULL"])
 
   (sql/do-commands
    "CREATE INDEX idx_catalogs_hash ON catalogs(hash)")

  "Migrates database to the latest schema version. Does nothing if database is
already at the latest schema version."
  []
  (sql/transaction
    (if-let [pending (seq (pending-migrations))]
      (doseq [[version migration] pending]
        (log/info (format "Migrating to version %d" version))
        (migration)
        (record-migration! version))
      (log/info "There are no pending migrations"))) )

along with the time at which the migration was performed."
  [version]
  {:pre [(integer? version)]}
  (let [timestamp (java.sql.Timestamp. (.getTime (java.util.Date.)))]
    (sql/insert-record :schema_migrations {:version version :time timestamp})))

(defn pending-migrations
  "Returns a collection of pending migrations, ordered from oldest to latest."
