IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33164


Ignore:
Timestamp:
Jan 26, 2012, 4:05:27 PM (14 years ago)
Author:
rhenders
Message:

method to drop all DVO detections from database, but not Images and SkyTables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/scratchdb.py

    r33160 r33164  
    225225    def getTotalSizeOfIngestedDvoFiles(self):
    226226
    227         sql = "SELECT SUM(size) FROM " + self.dvoDoneTable + " where path LIKE '%cpm' OR path LIKE '%cpt'"
     227        sql = "SELECT SUM(size) FROM " + self.dvoDoneTable + " WHERE path LIKE '%cpm' OR path LIKE '%cpt'"
    228228        try:
    229229            rs = self.executeQuery(sql) 
     
    326326
    327327    '''
     328    Resets only the detection table info from DVO ingest
     329    '''
     330    def resetOnlyDetectionDvoTables(self):
     331
     332       self.logger.infoPair("Deleting detections from", self.dvoDoneTable)
     333       sql = "DELETE FROM " + self.dvoDoneTable + " WHERE path LIKE '%cpm' OR path LIKE '%cpt'"
     334       try: self.execute(sql)
     335       except:
     336           self.logger.errorPair("Unable to delete from", self.dvoDoneTable)
     337           return False
     338
     339       self.logger.infoPair("Deleting detections from", self.dvoDetectionTable)
     340       sql = "DELETE FROM " + self.dvoDetectionTable
     341       try: self.execute(sql)
     342       except:
     343           self.logger.errorPair("Unable to delete from", self.dvoDetectionTable)
     344           return False
     345
     346       return True
     347
     348    '''
    328349    Drops and recreates tables necessary for dvoToMySQL program. Be very careful before using this...
    329350    '''
Note: See TracChangeset for help on using the changeset viewer.