---
title: "Additional database-specific rake tasks for multi-database users"
description: "Additional database-specific rake tasks for multi-database users"
canonical_url: "https://www.bigbinary.com/blog/rails-6-1-adds-additional-database-specific-tasks"
markdown_url: "https://www.bigbinary.com/blog/rails-6-1-adds-additional-database-specific-tasks.md"
---

# Additional database-specific rake tasks for multi-database users

Additional database-specific rake tasks for multi-database users

- Author: Amit Gupta
- Published: January 13, 2021
- Categories: Rails 6.1, Rails

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.

- rails db:migrate:primary
- rails db:create:primary
- rails db:drop:primary

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.

```ruby

> 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.

- rails db:schema:dump:primary
- rails db:schema:load:primary
- rails db:test:prepare:primary

Check out the [pull request](https://github.com/rails/rails/pull/38449) for more
details.

## Links

- [Human page](https://www.bigbinary.com/blog/rails-6-1-adds-additional-database-specific-tasks)
