a little bit of cleaning for the upgrade scripts

This commit is contained in:
did 2012-05-29 16:24:28 -07:00
parent b706d50bdf
commit 261575eb94
2 changed files with 7 additions and 3 deletions

View File

@ -43,4 +43,8 @@ collection.find.each do |page|
locale = get_locale(page['site_id']) locale = get_locale(page['site_id'])
collection.update({ '_id' => page['_id'] }, { '$set' => { 'redirect_url' => { locale => page['redirect_url'] } } }) collection.update({ '_id' => page['_id'] }, { '$set' => { 'redirect_url' => { locale => page['redirect_url'] } } })
end end
# Update Norwegian locale from 'no' to 'nb'
collection = db.collections.detect { |c| c.name == 'locomotive_accounts' }
collection.update({ 'locale' => 'no' }, { '$set' => { 'locale' => 'nb' }}, { :multi => true })

View File

@ -358,8 +358,8 @@ if collection = db.collections.detect { |c| c.name == 'pages' }
end end
# Update Norwegian locale from 'no' to 'nb' # Update Norwegian locale from 'no' to 'nb'
if collection = db.collections.detect {|c| c.name == 'locomotive_accounts'} if collection = db.collections.detect { |c| c.name == 'locomotive_accounts' }
collection.update({ 'locale' => 'no' }, { '$set' => {'locale' => 'nb'}}, {:multi => true}) collection.update({ 'locale' => 'no' }, { '$set' => { 'locale' => 'nb' } }, { :multi => true })
end end
# some cleaning # some cleaning