Database migrations for next.jdbc and PostgreSQL.
Documentation: https://cljdoc.org/d/daaku/pgmig
Make a directory that contains your migrations. You can put this in your
resources directory and load it from your jar if that makes
sense. The library will run thru all the files in sorted order.
The suggested naming convention is 000_first.sql, 001_second.sql and so
on.
The library:
pgmig_migrate to manage the migration
state.To use it:
(ns myapp
(:require [clojure.java.io :as io]
[daaku.pgmig :as pgmig]))
(def db-spec {:dbtype "postgres" :dbname "myapp"})
(def migrations
(delay (pgmig/migrations-from-dir (io/resource "myapp/migrations"))))
(defn start []
(pgmig/migrate db-spec @migrations))
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |