Permalink
Browse files

handle syncing indexes

  • Loading branch information...
1 parent 5544579 commit 69de557b602f2db9954c39ecf7855be35c82c716 @benwyrosdick benwyrosdick committed Apr 29, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/heroku/command/mongo.rb
@@ -37,7 +37,17 @@ def transfer(from, to)
display " done"
end
- display "Syncing users..."
+ display "Syncing indexes...", false
+ dest_index_col = dest.collection('system.indexes')
+ origin_index_col = origin.collection('system.indexes')
+ origin_index_col.find().each do |index|
+ if index['_id']
+ dest_index_col.insert index
+ end
+ end
+ display " done"
+
+ display "Syncing users...", false
dest_user_col = dest.collection('system.users')
origin_user_col = origin.collection('system.users')
dest_user_col.find().each do |user|
@@ -46,6 +56,7 @@ def transfer(from, to)
origin_user_col.find().each do |user|
dest_user_col.insert user
end
+ display " done"
end
def heroku_mongo_uri

0 comments on commit 69de557

Please sign in to comment.