joplin
joplin copied to clipboard
Question: best way to use more than 1 data store in a migration?
I'd like to write a migration that loads data from PG and indexes it with ES. What's the recommended way of doing that with Joplin?
I would use a ES seed function for this.
If you need specific mappings in the ES index I'd do that in a migrator.
If this is something you want to do repeatedly, I'd make the seed function idempotent and add it to a cron job.
On 10 Feb 2015, at 20:09, Michael Klishin [email protected] wrote:
I'd like to write a migration that loads data from PG and indexes it with ES. What's the recommended way of doing that with Joplin?
— Reply to this email directly or view it on GitHub.
Seeds are not an option: we'd like to not have any seeds in production. What's the best way to access connection info of other data stores from a migrator?
I see your problem, even with seeds there is no way of getting the target
map for the other db/migrator combinations in that environment.
One potential fix is to pass the joplin "conf" map through to the core multi-methods which would allow you to call joplin.main/get-targets
to extract the info.
@martintrojer ok, I'll have a look.
@martintrojer should conf
then be the 2nd (optional) argument the up
and down
functions accept?
sounds reasonable, please add it to args of the seed functions aswell.