https://github.com/mbuczko/revolt-flyway-task
Flyway based migrations task for revolt
https://github.com/mbuczko/revolt-flyway-task
clojure database migrations
Last synced: about 2 months ago
JSON representation
Flyway based migrations task for revolt
- Host: GitHub
- URL: https://github.com/mbuczko/revolt-flyway-task
- Owner: mbuczko
- Created: 2018-06-20T21:18:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-04T21:12:26.000Z (almost 7 years ago)
- Last Synced: 2025-11-15T22:03:30.365Z (7 months ago)
- Topics: clojure, database, migrations
- Language: Clojure
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://clojars.org/defunkt/revolt-flyway-task)
# Database migrations with Flyway and Revolt
Assuming `resources/db/migrations/postgres` to be a path where flyway migration files are located.
## deps.edn
``` clojure
{: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
``` clojure
: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`
``` clojure
(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`