开发者

Rails 3: Migrate DB Schema from SQLite to MongoDB

开发者 https://www.devze.com 2023-02-10 19:04 出处:网络
开发者_开发技巧Is there an easy way to migrate DB Schema from SQLite (Development Env) and PostgreSQL (Heroku Production Env) to MongoDB?\"mongoimport\" supports import of data through CSV or JSON for
开发者_开发技巧

Is there an easy way to migrate DB Schema from SQLite (Development Env) and PostgreSQL (Heroku Production Env) to MongoDB?


"mongoimport" supports import of data through CSV or JSON format. If you can: export your data in one of those formats.

More complex data structure likely require some kind of migration/import script to be written by you.


I am currently in the process of setting up a new Rails app that will use mongoDB on the backend. I think that migrating your schema would depend on which ODM you choose to use. Personally, I choose Mongoid because it seemed to fit the best between Rails and mongo.

As far how to migrate your schema. I don't have an exact answer for you, but Mongoid seems to really implement the feature of ActiveRecord nicely and uses the same conventions. I would think this is something that you would just want to do manually.

0

精彩评论

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