We write about Ruby on Rails, React.js, React Native, remote work, open source, engineering and design.
Rails 6.1 provides additional tasks to work with a specific database when working in a multi database setup.
Before Rails 6.1, only the following tasks worked on a specific database.
But some tasks that could be applied to a specific database were missing. Let's checkout an example.
Before Rails 6.1, running a top level migration on a multi-database project, dumped the schema for all the configured databases, but if a database specific migration was run, the schema was not dumped. And there were no tasks to manually dump the schema of a specific database.
> rails db:schema:dump:primary
rails aborted!
Don't know how to build task `db:schema:dump:primary` (See the list of available tasks with `rails --tasks`)
Did you mean? db:schema:dump
Therefore, in Rails 6.1, the following database specific tasks were introduced.
Check out the pull request for more details.