Skip to main content
What's New in Rails 6.0:

The Rails db:system:change command

24

Episode 291 · April 3, 2019

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.

Rails 6


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.

Transcripts

No transcripts available. Earn a free month

Loading...

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.