How to Change Rails Database
If you’re like me, you probably always forget what the command is to change databases in your Ruby on Rails applications. Well don’t worry, future Dean, because from now on you can just search, “Rails Change Database” and hopefully this will pop up.
If you aren’t future me, then uh, I hope this helps. But I mostly wrote this for myself to remember how to change the database in a Rails project.
rails db:system:change --to=postgresql
rails db:system:change --to=sqlite3
rails db:system:change --to=mysql
# Don't forget to setup and migrate
rails db:create
rails db:migrate
rails db:seed