How to migrate from SQLite to PostgreSQL (Rails)

女生的网名这么多〃 提交于 2019-11-29 17:09:29

问题


I'm a DB noob so please be kind with me.

I'm having some issues pushing my SQLite DB to Heroku via taps gem. Talking with them, they told me one of the solutions could be converting locally my DB from SQLite to PostgreSQL. Is there an easy way to do so?

Thanks

More info: - DB from Rails app - I'm on Mac OS X - Just installed PostgreSQL via macports


回答1:


sqlite3 development.db .dump | psql dbname username




回答2:


Sequel will help you

gem install sequel

sequel -C sqlite://db/development.sqlite3 postgres://username:password@localhost/dbname


来源:https://stackoverflow.com/questions/4248072/how-to-migrate-from-sqlite-to-postgresql-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!