Additional database-specific rake tasks for multi-database users

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Additional database-specific rake tasks for multi-database users

Kyle Thompson
Hello,

I'm in the process of converting a Rail application over to Rails 6 from Rails 5. In that application, we have a large number of databases and we do some parallelization to speed up creation, migration, and test preparation for those databases.

Previously, we were using multiverse for this. When we ran a top-level bundle exec rails db:migrate, the database would be dumped to the schema file. Today in Rails 6, that's still the case when running all migrations, but when running database-specific migrations with bundle exec rails db:migrate:DATABASE, the schema is not dumped.

Unfortunately, that means that we can only parallelize the creation and migration of the databases. After that, we have to serially run bundle exec rails db:structure:dump and bundle exec rails db:test:prepare.

I'd like to propose supporting database-specific tasks for db:structure:dump and db:test:prepare to handle this situation. I'm willing to open PRs to support this assuming this seems reasonable to everyone.

Thanks!
- Kyle Thompson

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/f41aabaa-c381-4783-bb5c-2de78f7ad043%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Additional database-specific rake tasks for multi-database users

Jeremy Daer
Sounds great Kyle! Looking forward to your PRs.

On Tue, Feb 11, 2020 at 3:22 PM Kyle Thompson <[hidden email]> wrote:
Hello,

I'm in the process of converting a Rail application over to Rails 6 from Rails 5. In that application, we have a large number of databases and we do some parallelization to speed up creation, migration, and test preparation for those databases.

Previously, we were using multiverse for this. When we ran a top-level bundle exec rails db:migrate, the database would be dumped to the schema file. Today in Rails 6, that's still the case when running all migrations, but when running database-specific migrations with bundle exec rails db:migrate:DATABASE, the schema is not dumped.

Unfortunately, that means that we can only parallelize the creation and migration of the databases. After that, we have to serially run bundle exec rails db:structure:dump and bundle exec rails db:test:prepare.

I'd like to propose supporting database-specific tasks for db:structure:dump and db:test:prepare to handle this situation. I'm willing to open PRs to support this assuming this seems reasonable to everyone.

Thanks!
- Kyle Thompson

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/f41aabaa-c381-4783-bb5c-2de78f7ad043%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CA%2B4DrRaRni-t0JUOHeGQxbDD79FMShBS%2B%2BStLD0JieQoDirwjw%40mail.gmail.com.