Fork me on GitHub
#duct
<
2023-06-04
>
Franklin08:06:11

Hello 👋 I'm currently following https://github.com/duct-framework/docs/blob/master/GUIDE.rst. I'm trying to run migrations by calling (reset) from the integrant.repl namespace in the REPL. For some reason, the migrations don't run at all.. I've checked by sqlite DB and my tables arent created

Franklin08:06:28

My config.edn file looks as follows

{:duct.profile/base
 {:duct.core/project-ns todo

  :duct.router/ataraxy
  {:routes {[:get "/"] [:todo.handler/index]}}

  [:duct.handler.static/ok :todo.handler/index]
  {:body {:entries "/index"}}

  [:duct.migrator.ragtime/sql :todo.migration/create-entries]
  {:up ["CREATE TABLE entries (id INTEGER PRIMARY KEY, description TEXT)"]
   :down ["DROP TABLE entries"]}

  :duct.migrator/ragtime
  {:migration [#ig/ref :todo.migration/create-entries]}}

 :duct.profile/dev   #duct/include "dev"
 :duct.profile/local #duct/include "local"
 :duct.profile/prod  {}

 :duct.module/logging {}
 :duct.module.web/api
 {}
 :duct.module/sql
 {}}

iperdomo18:06:31

the (reset) function in this guide is from the dev namespace, see the dev=> prefix in the docs

iperdomo18:06:02

e.g. > To apply the migration we run reset again at the REPL: >

dev=> (reset)
> :reloading ()
> :duct.migrator.ragtime/applying :todo.migration/create-entries#b34248fc
> :resumed

Franklin03:06:53

Thanks @U0GTGHX1D I actually ran (reset) in the dev namespace

Franklin03:06:04

After hours of looking at my config, I have noticed that https://clojurians.slack.com/archives/C5K1SHR6X/p1685868268690129?thread_ts=1685868251.377709&amp;cid=C5K1SHR6X, I needed migrations and not migration :face_holding_back_tears: :face_holding_back_tears:

iperdomo03:06:05

> (reset) from the integrant.repl namespace in the REPL.

iperdomo03:06:46

you suggested that the (reset) was called from integrant.repl ... good that you found the problem

👀 2
Franklin04:06:27

yes, my mistake... Thank!