Fork me on GitHub
#luminus
<
2016-03-18
>
plexus13:03:59

does anyone see what I'm doing wrong here?

plexus13:03:53

> IllegalArgumentException db-spec mount.core.DerefableState@3b36e8 is missing a required parameter clojure.java.jdbc/get-connection (jdbc.clj:292)

actsasgeek14:03:18

based on the output from mount {:started ["#'lumiblog.config/env" "#'lumiblog.core/http-server”]} if you have a separate db somewhere, it didn’t get started/initialized.

plexus14:03:06

yup, I just figured it out. Nothing is requiring lumiblog.db.core, so mount is unaware of it and it doesn't get started

plexus14:03:08

requiring <myapp>.db.core from <myapp>.core fixes it

yogthos15:03:01

yeah it’s a bit of a gotcha with mount that namespaces have to be used somewhere for the states to get initialized automatically

yogthos15:03:13

by the way, the default way would be to run lein run migrate

yogthos15:03:28

Luminus bundles migrations with the app, so that you’re able to run them from the resulting jar as well when you deploy

plexus15:03:19

so what's the difference exactly between lein run migrate and lein migratus?

lmergen16:03:13

i think they're both aliases to the same functionality

yogthos17:03:24

@plexus: lein migratus runs the migratus-lein plugin, the plugin is mostly handy for creating migration files

yogthos17:03:24

although I’m not able to replicate the problem using the latest template:

yogthos17:03:03

or rather sorry, misread the original message

yogthos17:03:09

your migrations run fine

yogthos17:03:19

but you’re starting via lein repl

yogthos17:03:36

so the whole migrations thing is a red herring, you can do either and they’ll work, it was just that the db wasn’t used anywhere and (start) didn’t load it