Fork me on GitHub
#duct
<
2018-07-31
>
nbdam13:07:43

Hi, what is the recomended strategy for expanding integrant keys with code. I want to load migration files from resources folder and than crate :duct.migrator/ragtime :migrations vector from them...

weavejester13:07:02

It sounds like you might want to write a module.

weavejester13:07:01

Though modules are pure, so you’d need to combine that with something side-effectful.

weavejester13:07:39

Actually… wait, ignore all that 🙂

weavejester13:07:41

Yes, so the :migrations key in migrator.ragtime is just a vector, so you can supply it with a reference that produces a vector of migrations when it’s initiated.

weavejester13:07:39

So all you need is to write a ig/init-key method that returns a vector of Ragtime migrations.

nbdam13:07:32

thx.. just reading the docs..

nbdam13:07:57

this seems to be everyting needed...

nbdam13:07:40

couldn't find that part about modules, was looking in integrant docs...

weavejester13:07:42

I don’t think you don’t need a module for this. I’d forgotten that I was already thinking about this problem when I wrote the ragtime migrator to begin with.

weavejester13:07:38

You just need a key that returns an ordered collection of Ragtime migrations when initiated.