Skip to content

Commit 56e85a9

Browse files
authored
Merge pull request rails#54318 from german/add_db_system_change_command_to_doc
Added documentation for `rails db:system:change` command
2 parents fb1f3d3 + 83f3048 commit 56e85a9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

guides/source/command_line.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,30 @@ The most common commands of the `db:` rails namespace are `migrate` and `create`
551551
552552
More information about migrations can be found in the [Migrations](active_record_migrations.html) guide.
553553
554+
#### Switching to a Different Database Later
555+
556+
After creating a new Rails application, you have the option to switch to any
557+
other supported database. For example, you might work with SQLite for a while and
558+
then decide to switch to PostgreSQL. In this case, you only need to run:
559+
560+
```bash
561+
$ rails db:system:change --to=postgresql
562+
conflict config/database.yml
563+
Overwrite config/database.yml? (enter "h" for help) [Ynaqdhm] Y
564+
force config/database.yml
565+
gsub Gemfile
566+
gsub Gemfile
567+
...
568+
```
569+
570+
And then install the missing gems:
571+
572+
```bash
573+
$ bundle install
574+
...
575+
576+
```
577+
554578
### `bin/rails notes`
555579
556580
`bin/rails notes` searches through your code for comments beginning with a specific keyword. You can refer to `bin/rails notes --help` for information about usage.

0 commit comments

Comments
 (0)