You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/source/command_line.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -551,6 +551,30 @@ The most common commands of the `db:` rails namespace are `migrate` and `create`
551
551
552
552
More information about migrations can be found in the [Migrations](active_record_migrations.html) guide.
553
553
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
+
554
578
### `bin/rails notes`
555
579
556
580
`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