Permalink
Browse files

change ns on imported indexes

  • Loading branch information...
1 parent 01cdc66 commit 9d6804d7d7bb3736fd0de0cbe7ac7753b082e780 @benwyrosdick benwyrosdick committed Apr 29, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/heroku/command/mongo.rb
@@ -41,7 +41,10 @@ def transfer(from, to)
dest_index_col = dest.collection('system.indexes')
origin_index_col = origin.collection('system.indexes')
origin_index_col.find().each do |index|
- dest_index_col.insert index
+ if index['_id']
+ index['ns'] = index['ns'].sub(origin_index_col.db.name, dest_index_col.db.name)
+ dest_index_col.insert index
+ end
end
display " done"

0 comments on commit 9d6804d

Please sign in to comment.