Assuming resources/db/migrations/postgres
to be a path where flyway migration files are located.
{: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.migrations.task/flyway {:jdbc-url "jdbc:postgresql://localhost:5432/template1"
:locations ["db/migrations/postgres"]
:user "postgres"
:action :info}
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})
clj -A:dev -t revolt.migrations.task/flyway
clj -A:dev -t revolt.migrations.task/flyway:action=migrate