开发者

Migrating SQLite data from Rails 2 to 3

I'm in the process of migrating the data from a Rails 2 application, to a new Rails 3 application. The new database shares a number of columns with the 开发者_JAVA技巧old database, and I'm looking to copy some of the data over from the old database to the new one.

How should I go about this?


If it's a large amount of data what I'd do is dump the data you want into a file, then either in a separate rake task or the seeds.rb file do something like:

sql = **read in your file***
ActiveRecord::Base.connection.execute(sql)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜