Rails: Switching the Database in Use to Another

Blog ยป Rails: Switching the Database in Use to Another

Posted on 05 Jun 2009 00:09

You might easilty switch to another database in Rails. But defautl Rails projects use SQLite. To see the supported databases execute:

rails | grep database

If you want to use Postgresql, for example, create a dummy project with it:

rails dummy -d postgresql

Then copy and edit dummy/config/database.yml on to your_project/config/database.yml and create the tables

cd your_project
rake db:create:all
rake db:migrate

If you like this page, please spread the word: diggdel.icio.usFacebook

You can contact me if you have questions or corrections.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License