I have been switching between Sqlite and PosgreSQL for my Rails applications. Considering how easy it’s been to move a sqlite3 dev database to Heroku hosted PostgreSQL, I haven’t had much need for PostgreSQL lately. However, I’d like to avoid any surprises because of DB-specific SQL.
So, I just created a Rails/PostgreSQL app, and am documenting the steps for posterity.
- Create a Rails app with ‘rails new myapp -d postgresql’
- Create database
- Modify config/database.yml with the username/password that you just created
- Then run ‘bundle exec rake db:migrate’