Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: best way to use more than 1 data store in a migration? #49

Open
michaelklishin opened this issue Feb 10, 2015 · 6 comments
Open

Comments

@michaelklishin
Copy link
Contributor

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?

@martintrojer
Copy link
Contributor

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 notifications@github.com 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.

@michaelklishin
Copy link
Contributor Author

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?

@martintrojer
Copy link
Contributor

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.

@michaelklishin
Copy link
Contributor Author

@martintrojer ok, I'll have a look.

@michaelklishin
Copy link
Contributor Author

@martintrojer should conf then be the 2nd (optional) argument the up and down functions accept?

@martintrojer
Copy link
Contributor

sounds reasonable, please add it to args of the seed functions aswell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants