Fork me on GitHub
#luminus
<
2018-04-03
>
clark17:04:40

hi folks, looking for a few pointers regarding: https://github.com/luminus-framework/boot-migratus

clark17:04:48

after setting up my config in build.boot, I can run (boot (migratus :command "create" :options "ok")) in REPL and the task runs

clark17:04:07

as far as I can tell, it is only writing the generated migration to boot's tmpfiles

clark17:04:49

I have dug around in the boot documentation on filesets and tasks, and I am still pretty unclear as to how to get the task to sync the migration to my project rather than boot's ephemeral fs

clark17:04:15

in my task-options! my migratus config looks like this:

clark17:04:26

migratus {:config
           (fn []
             (require '[creader.config])

             (let [connection (resolve 'creader.config/migration-connection)
                   load-config (resolve 'creader.config/load-config)
                   load-profile (resolve 'creader.config/load-profile)]

               (println "conn: " connection)
               (println "load-config: " load-config)
               (println "load-profile: " load-profile)
               (println "config: " (load-config (load-profile)))
               (println "conn: " (connection (load-config (load-profile))))

               (connection (load-config (load-profile)))))}

clark17:04:34

and running it looks like this:

clark17:04:45

boot.user> (boot (migratus :command "create" :options "ok"))
conn:  #'creader.config/migration-connection
load-config:  #'creader.config/load-config
load-profile:  #'creader.config/load-profile
config:  {:webserver {:port 3000}, :db {:password nil, :classname org.postgresql.Driver, :hostname localhost, :subprotocol postgresql, :database creader_dev, :init-script init-dev.sql, :migration-table-name schema_version, :user nil, :subname creader_dev}}
conn:  {:store :database, :migration-dir migrations/, :init-script init-dev.sql, :init-in-transaction? false, :migration-table-name schema_version, :db {:classname org.postgresql.Driver, :subprotocol postgresql, :subname creader_dev}}
nil

clark17:04:09

if this question is better for #boot , I can take it there, no worries

donyorm14:04:49

Best place is definetely here. I'm pretty sure if you run (boot (migratus :command "create" :options "ok") (target) you'll get your output files in the target folder of your directory

donyorm15:04:54

The luminus docs now have boot information on them, so you can look at those as well.