开发者

Converting a ruby on rails app from sqlite to postgresql

开发者 https://www.devze.com 2023-04-12 00:50 出处:网络
I am going to use thinking sphinx for my application and开发者_如何学JAVA it requires a conversion to postgresql. I have downloaded both sphinx and postgresql using homebrew, but I am unsure how to co

I am going to use thinking sphinx for my application and开发者_如何学JAVA it requires a conversion to postgresql. I have downloaded both sphinx and postgresql using homebrew, but I am unsure how to convert the rest of the application. I do not care about saving my data, as I only have about 5 records in my database. If there is a step by step guide, or a resource that could guide me I would appreciate it.


It's a very simple process if you have stuck to using activerecord and not used any custom SQL.

All you'll need to do is change your gemfile to include gem 'pg' and change the database.yml file to have something like the following:

  development:
    adapter: postgresql
    database: example_development
    username: postgres
    password: secret
    host: localhost
    encoding: UTF8

If you have used custom SQL, you'll just need to convert it to PostgreSQL, which shouldn't be too tricky as it's very similar.


http://devcenter.heroku.com/articles/database#common_issues_migrating_to_postgresql


I used the following video from Peter Cooper to figure out what I was doing wrong. If anyone needs to set up Postgresql in the future reference this: http://www.youtube.com/watch?v=pf5jPUJAeU4

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号