开发者

Migrating SQLite data from Rails 2 to 3

开发者 https://www.devze.com 2023-03-26 03:34 出处:网络
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 t

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

精彩评论

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