From ad3df313611c3f0bc667a026125999c9a40a44a8 Mon Sep 17 00:00:00 2001 From: Greg Rynkowski Date: Mon, 1 Jul 2019 18:13:38 +0100 Subject: [PATCH] Add info about db location when running migrator Getting trough the tutorial one might come across an issue when running the command `lein run :duct/migrator`. It doesn't work unless ``:duct.database.sql/hikaricp`` is added to the project config or one of [`JDBC_DATABASE_URL`, `DATABASE_URL`] is set. More about: https://github.com/duct-framework/docs/issues/5 --- GUIDE.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GUIDE.rst b/GUIDE.rst index 42c194c..523e819 100644 --- a/GUIDE.rst +++ b/GUIDE.rst @@ -318,6 +318,17 @@ We can easily run migrations in production:: $ lein run :duct/migrator +Notice: + Keep in mind that ``:duct.migrator/ragtime`` (descendant of + ``:duct/migrator``) depends on ``:duct.database/sql`` (thanks to applying + module ``:duct.module/sql``). That provides database location to the migrator. + It means that unless the ``:duct.database/sql`` (or its descendant like + ``:duct.database.sql/hikaricp``) is given in the project configuration, + one of environment variables ``JDBC_DATABASE_URL`` or ``DATABASE_URL`` + has to be set to make the command working, e.g. + + $ export DATABASE_URL="jdbc:sqlite:db/dev.sqlite" + If you are using Heroku for deployment, this can be added to the release phase via your Procfile::