giorgio wrote in post #967970: > I want to merge several identical databases together. > > There is obviously a problem in that the primary keys (id) will change > when imported and thus any foreign keys that refer to that id will > have to be changed as well. > > This is all doable but I wonder if there are any plugins that would > make this sort of task easier?
Have you got foreign key constraints set up in your DBs? If not, do so now (and use Foreigner for your migrations), and make sure cascading updates are on. That will change the foreign keys when the primary keys change. Then renumber your primary keys somehow and merge the DBs. Or at least that's one idea. If it were just one table, I'd advise doing an SQL dump and insert, but I'm not sure how that would work with associated records. > > Cheers > George Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

