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

Already on GitHub? Sign in to your account

multiple databases migration #60

Closed
trungpham opened this Issue Sep 30, 2012 · 13 comments

Comments

Projects
None yet
6 participants

How do you go about achieving this?

I have two different databases.

one called user_db, the other called log_db.

And I want to keep migration files for user_db in its own directory and keep the migration files for log_db in another directory.

Therefore when I run the migration rake task, it needs to accept an argument of which database to apply the migration scripts against.

Collaborator

mistersourcerer commented Oct 1, 2012

Fair enough. Let's just see how the #61 evolves and maybe I can document all you need to do this.
But I think this is something relatively easy to achieve. Give me a couple of days, can you?

I was just looking at hacking something together for this is as well. Would love to see what you guys suggest before heading too far into the weeds. Thanks!

Collaborator

mistersourcerer commented Oct 10, 2012

Hey @rockpunk, go for it man. =) I suggest you to do some read on the https://github.com/thuss/standalone-migrations/blob/master/lib/standalone_migrations/configurator.rb. I'd probably start from there.

Please, do some specs for the implementation and anything you need, just ask. If I'm capable of, I will help you.

Perhaps I should be specific. I'm looking into using the standalone-migrations library as it exists now to hopefully provision multiple databases using migrations and/or seed data. I was looking for some conceptual advice on how one might do that with this library. If support for this doesn't exist, I will look into hacking something myself for my current project, but I doubt it will be production ready for everyone.

At any rate, I'd be happy to contribute whatever it is I'll come up with, but I'd like to leave the overall library design and guidelines to someone who has more knowledge/opinion of the architecture. (i just started looking at this yesterday!) If you have some idea of how you'd like the Configurator class to work with multiple connections, let me know and I might be able to work that into whatever I hack together on my end.

Collaborator

mistersourcerer commented Oct 10, 2012

Understood @rockpunk, cristal clear now. Right now I'm not able to do this analysis. But I'm planning to make some time for this, I promise I will mention you on this issue when I do something about it. Of course, if anyone do this before me. =)

Collaborator

mistersourcerer commented Oct 28, 2012

Awesome Ricardo, I think that will work. Thanks!

On Sun, Oct 28, 2012 at 3:31 PM, Ricardo Valeriano <notifications@github.com

wrote:

Hey @trungpham https://github.com/trungpham and @rockpunkhttps://github.com/rockpunk,
can you take a look at this documentation and say me if it's will work for
your needs?

https://github.com/thuss/standalone-migrations/blob/93b0e41ba66c23cc233a09ff0c01187a2502feab/README.markdown#multiple-database-support


Reply to this email directly or view it on GitHubhttps://github.com/thuss/standalone-migrations/issues/60#issuecomment-9851774.

Collaborator

mistersourcerer commented Oct 29, 2012

Nice @rockpunk. I'm almost finished with the implementation, I'll try to push it to the repo until tomorrow.

Collaborator

parkr commented Jan 31, 2013

This is interesting! I've been working on a solution for multi db support for all of the rake db support. If you have a quick solution, that would be super sweet!

Contributor

morcmarc commented Apr 2, 2013

+1 This feature would be so helpful. Did you manage to finish the implementation in the end? I'm happy to help you out in case you're busy.

morcmarc added a commit to morcmarc/standalone-migrations that referenced this issue Apr 3, 2013

Contributor

morcmarc commented Apr 3, 2013

I've updated the code to load custom configurations depending on the environment variable passed. Have a look at the Readme: https://github.com/morcmarc/standalone-migrations/tree/develop#multiple-database-support
Let me know whether you like it and I'll submit a pull request.

Collaborator

parkr commented Apr 3, 2013

I like it a lot!

morcmarc added a commit to morcmarc/standalone-migrations that referenced this issue Apr 4, 2013

Contributor

morcmarc commented Apr 8, 2013

Added in pull request #78, I believe we could close this issue now. For follow up see #80.

@twobitlabs twobitlabs closed this Apr 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment