samedi 4 juillet 2015

EASILY change database from SQLite to PostgreSQL in ROR

There has got to be a straight forward explanation somewhere on how to change from sqlite to postgresgl on windows, but Ive been unable to find one. Im trying to deploy my rails app to heroku, but of course I need to use postgresql to deploy. Ive been using sqlite for development and I have no idea what I need to do to set up postgresgl and migrate the database to it. So far Ive installed postgresgl and pgAdmin and Ive added gem 'pg' and moved gem 'sqlite3' to a development group in my rails app. from there I'm completely lost. Please help!

database.yml

development:
  adapter: postgresql
  database: david_youtube_development
  pool: 5
  timeout: 5000
  password: password

test:
  adapter: postgresql
  database: david_youtube_test
  pool: 5
  timeout: 5000
  password: password

production:
  adapter: postgresql
  database: david_youtube_production
  pool: 5
  timeout: 5000
  password: password

Aucun commentaire:

Enregistrer un commentaire