Your Teacher
Chris Oliver
Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.
About This Episode
Changing the database adapter for a Rails app has always been an annoying, manual change to make. Rails 6.0 introduces the "rails db:system:change" command to make this easier using all the built-in generators for database.yml and more.
Notes
To use the Rails 6 db system change command, you simply need to specify the new database adapter with the --to
option.
rails db:system:change --to=postgresql
rails db:system:change --to=mysql
rails db:system:change --to=sqlite3
rails db:system:change --to=oracle
rails db:system:change --to=frontbase
rails db:system:change --to=sqlserver
rails db:system:change --to=jdbc
Keep in mind, you may need to change the version numbers of the database adapter in your Gemfile after running this command.
What's New in Rails 6.0
0% Complete
The Rails db:system:change command
3m
2
How to use Javascript via Webpacker in Rails 6
14m
3
How to install TailwindCSS 1.0 with Rails 6
9m
4
How to use Bootstrap with Webpack & Rails
9m
5
Actionable Errors in Rails 6
8m
6
How to use Action Mailbox in Rails 6
19m
7
How to save ActionMailbox inbound HTML emails and attachments with ActionText and ActiveStorage
25m
8
How to use Multiple Databases in Rails 6.0
14m