@@ -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' ,'PostLinks' ,'Comments' ]
122+ , choices = ['Users' , 'Badges' , 'Posts' , 'Tags' , 'Votes' , 'PostLinks' , 'PostHistory' , 'Comments' ]
123123 )
124124
125125parser .add_argument ( '-d' , '--dbname'
@@ -249,7 +249,25 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
249249 , 'ExcerptPostId'
250250 , 'WikiPostId'
251251 ]
252-
252+ elif table == 'PostHistory' :
253+ keys = [
254+ 'Id' ,
255+ 'PostHistoryTypeId' ,
256+ 'PostId' ,
257+ 'RevisionGUID' ,
258+ 'CreationDate' ,
259+ 'UserId' ,
260+ 'Text'
261+ ]
262+ elif table == 'Comments' :
263+ keys = [
264+ 'Id' ,
265+ 'PostId' ,
266+ 'Score' ,
267+ 'Text' ,
268+ 'CreationDate' ,
269+ 'UserId' ,
270+ ]
253271choice = raw_input ('This will drop the {} table. Are you sure [y/n]?' .format (table ))
254272
255273if len (choice ) > 0 and choice [0 ].lower () == 'y' :
0 commit comments