#NEWLINE# def upgrade_to_v3( ) : #NEWLINE# #INDENT# print ( 'Upgrading to v3...' ) #NEWLINE# cursor = db . players . find ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'scid' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# for player in cursor : #NEWLINE# #INDENT# db . scopeaccess . update ( { #NEWLINE# #INDENT# 'uid' : player [ '_id' ] , #NEWLINE# 'scid' : player [ 'scid' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'uid' : player [ '_id' ] , #NEWLINE# 'scid' : player [ 'scid' ] , #NEWLINE# 'level' : twcommon . access . ACC_FOUNDER , #NEWLINE# #UNINDENT# } , upsert = True )