Skip to content

Commit e5a724a

Browse files
authored
Merge pull request rails#50438 from fatkodima/schema_dump-docs
Add `schema_dump` docs to the multiple databases docs [skip ci]
2 parents c4cad76 + 17f5a8c commit e5a724a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

guides/source/active_record_multiple_databases.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ Lastly, for new writer databases, you need to set the `migrations_paths` to the
102102
where you will store migrations for that database. We'll look more at `migrations_paths`
103103
later on in this guide.
104104

105+
You can also configure the schema dump file by setting `schema_dump` to a custom schema file name
106+
or completely skip the schema dumping by setting `schema_dump: false`.
107+
105108
Now that we have a new database, let's set up the connection model. In order to use the
106109
new database we need to create a new abstract class and connect to the animals databases.
107110

@@ -441,7 +444,7 @@ class ShardRecord < ApplicationRecord
441444
end
442445
```
443446

444-
If you're using shards, make sure to set the `migrations_paths` to the same path for
447+
If you're using shards, make sure both `migrations_paths` and `schema_dump` remain unchanged for
445448
all the shards. When generating a migration you can pass the `--database` option and
446449
use one of the shard names. Since they all set the same path, it doesn't matter which
447450
one you choose.

0 commit comments

Comments
 (0)