How to change the database in a Rails application ?

Alef Ojeda de Oliveira - Nov 8 '21 - - Dev Community

Hello guys !

sometimes I came across the need to change the application's database, because many times we start with a study project with Sqlite3 and then the project ends up getting bigger with another need and then we decided to change to another one like (PostgreSQL, MySQL, etc ...)!

So here's a nice little tip:

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
Enter fullscreen mode Exit fullscreen mode

**obs: only works from rails version 6 onwards

. . . . . . . . . . . . . . . .
Terabox Video Player