Skip to content

paulbutcher/clj-migratus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

clj-migratus

Migratus runner for native Clojure projects.

Usage

Add the following to your deps.edn:

:aliases {:migrate {:extra-deps {com.github.paulbutcher/clj-migratus {:git/tag "v1.0.3"
                                                                      :git/sha "46a3ac1"}}
                    :jvm-opts["-Dmigratus.config.path=<CLASSPATH_LOCATION>"]
                    :main-opts ["-m" "clj-migratus"]}}

Replace <CLASSPATH_LOCATION> with the location of the migratus config file on your classpath. If you do not provide the :jvm-opts, either migratus.edn or migratus.clj directly in your work directory will be tried.

Create a Migratus configuration file. This can either be migratus.edn:

{:store :database
 :migration-dir "migrations"
 :db {:classname "com.mysql.jdbc.Driver"
      :subprotocol "mysql"
      :subname "//localhost/migratus"
      :user "root"
      :password ""}}

Or (recommended) migratus.clj, allowing credentials to be taken from the environment:

{:store :database
 :db (get (System/getenv) "JDBC_DATABASE_URL")}

Then run, for example:

$ clj -M:migrate init
$ clj -M:migrate migrate
$ clj -M:migrate create create-user-table

See Migratus Usage for documentation on each command.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published