Fork me on GitHub
#duct
<
2021-06-13
>
Daniel15:06:49

Hello, I created a new duct project using

lein new duct foobar +postgres
Then I added [duct/migrator.ragtime "0.3.2"] to :dependencies Next I modified dev/config.edn to add the following key:
[:duct.migrator.ragtime/sql :foo.migration/create-foo-table]
 {:up   ["CREATE TABLE foo (id int);"]
  :down ["DROP TABLE foo;"]}}
But when I ran (dev) (go) no migrations are created in ragtime_migrations?

Daniel15:06:43

In the log file, I can see that the ragtime is trying to read from the migrations table:

INFO [duct.database.sql.hikaricp:30] - :duct.database.sql/query {:query ["SELECT id FROM ragtime_migrations ORDER BY created_at"], :elapsed 1}

Daniel16:06:47

Okay, I’ve fixed the above, now I’m trying to add a top-level duct module

Daniel16:06:16

So I’m following the instructions from: https://github.com/duct-framework/duct/wiki/Configuration#top-level-components But when I included this (derive :myapp/scheduler :duct/daemon) there’s an error:

:reloading (myapp.scheduler)
:error-while-loading myapp.scheduler
#error {
 :cause "Assert failed: (or (class? tag) (and (instance? clojure.lang.Named tag) (namespace tag)))"
 :via

Daniel16:06:15

If I remove the (derive) function, it runs when reloaded, but the ig/init-key doesn’t seem to be called

Daniel16:06:19

I’ve specified this in duct_hierarchy.edn:

{:myapp/scheduler [:duct/daemon]}

Daniel16:06:31

Anyway, found the error, its a typo somewhere

👍 2