@@ -74,7 +74,7 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
7474 if pre != '' :
7575 cur .execute (pre )
7676 conn .commit ()
77- print 'Pre-processing took {} seconds' .format (time .time () - start_time )
77+ print 'Pre-processing took {:.1f } seconds' .format (time .time () - start_time )
7878
7979 # Handle content of the table
8080 start_time = time .time ()
@@ -91,7 +91,7 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
9191 ' VALUES\n ' + valuesStr + ';'
9292 cur .execute (cmd )
9393 conn .commit ()
94- print 'Table processing took {} seconds' .format (time .time () - start_time )
94+ print 'Table processing took {:.1f } seconds' .format (time .time () - start_time )
9595
9696 # Post-processing (creation of indexes)
9797 start_time = time .time ()
@@ -119,7 +119,7 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
119119parser = argparse .ArgumentParser ()
120120parser .add_argument ( 'table'
121121 , help = 'The table to work on.'
122- , choices = ['Users' , 'Badges' , 'Posts' , 'Tags' , 'Votes' ]
122+ , choices = ['Users' , 'Badges' , 'Posts' , 'Tags' , 'Votes' , 'PostHistory' , 'Comments' ]
123123 )
124124
125125parser .add_argument ( '-d' , '--dbname'
@@ -232,7 +232,25 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
232232 , 'ExcerptPostId'
233233 , 'WikiPostId'
234234 ]
235-
235+ elif table == 'PostHistory' :
236+ keys = [
237+ 'Id' ,
238+ 'PostHistoryTypeId' ,
239+ 'PostId' ,
240+ 'RevisionGUID' ,
241+ 'CreationDate' ,
242+ 'UserId' ,
243+ 'Text'
244+ ]
245+ elif table == 'Comments' :
246+ keys = [
247+ 'Id' ,
248+ 'PostId' ,
249+ 'Score' ,
250+ 'Text' ,
251+ 'CreationDate' ,
252+ 'UserId' ,
253+ ]
236254choice = raw_input ('This will drop the {} table. Are you sure [y/n]?' .format (table ))
237255
238256if len (choice ) > 0 and choice [0 ].lower () == 'y' :
0 commit comments