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

Support migration --database option for install task? #267

Closed
leehericks opened this issue Jun 8, 2021 · 3 comments
Closed

Support migration --database option for install task? #267

leehericks opened this issue Jun 8, 2021 · 3 comments

Comments

@leehericks
Copy link

I know I'm overthinking and pre-optimizing, but would it make sense to want to setup good_job to use a different postgres database since Rails 6+ supports that?

For example using a Hobby Dev or Hobby Basic postgres on Heroku just for good_job.

rails g migration has the --database option for that when generating the migration.
Multiple Databases with Active Record

@bensheldon
Copy link
Owner

Good suggestion. I think it would be possible to pass the --database flag down through the install generator.

I believe that if someone is using multiple databases, they have a level of Rails experience to observe what's happening with the generated files and move them into the appropriate place. I can't recommend someone run multiple databases specifically for GoodJob.

@leehericks
Copy link
Author

Thanks for your reply. I was merely thinking that if one used Sidekiq then jobs would be hitting Redis and not bogging down your Postgres db, but GoodJob also uses Postgres so there isn't any reason not to silo it to a separate db instance. But again, premature optimization thinking.

@morgoth
Copy link
Collaborator

morgoth commented Jun 9, 2021

@leehericks Using separate database should already be possible via https://github.com/bensheldon/good_job#global-options GoodJob.active_record_parent_class
As it goes for migration, I believe it should be enough to move it from "db/migrate" to "db/your_second_db_migrate" so I'm not sure if this needs a CLI option.

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

3 participants