Skip to content

mbuczko/revolt-flyway-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojars Project

Database migrations with Flyway and Revolt

Assuming resources/db/migrations/postgres to be a path where flyway migration files are located.

deps.edn

{:paths ["resources"]
 :aliases {:dev {:extra-deps  {defunkt/revolt {:mvn/version "1.3.0"}
                               defunkt/revolt-flyway-task {:mvn/version "0.1.0"}
                               org.postgresql/postgresql {:mvn/version "42.1.4"}}
                 :main-opts   ["-m" "revolt.bootstrap"]}}}

revolt.edn

:revolt.migrations.task/flyway {:jdbc-url "jdbc:postgresql://localhost:5432/template1"
                                 :locations ["db/migrations/postgres"]
                                 :user "postgres"
                                 :action :info}

using a task with REPL

clj -A:dev -p rebel

(require '[revolt.task :as t])
(require '[revolt.migrations.task :as migrations])
(t/require-task ::migrations/flyway)

;; to see migrations status
(flyway)

;; to apply pending migrations
(flyway {:action :migrate})

;; to clean a schema
(flyway {:action :clean})

using a task from command-line

clj -A:dev -t revolt.migrations.task/flyway

clj -A:dev -t revolt.migrations.task/flyway:action=migrate

About

Flyway based migrations task for revolt

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published