Merging Rails databases
问题 I have two databases with the same structure. The tables have an integer as a primary key as used in Rails. If I have a patients table, I will have one patient using primary key 123 in one database and another patient using the same primary key in the other database. What would you suggest for merging the data from both databases? 回答1: Set both your databases up with entries in config/database.yml, then generate a new migration. Use ActiveRecord::Base.establish_connection to switch between