IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 12, 2014, 2:58:40 PM (12 years ago)
Author:
heather
Message:

cleaning up the schema, and adding uniquePsps()id to all tables. Populated in
all except FO/FW/DF/DO (those are still in progress)

File:
1 edited

Legend:

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

    r37577 r37592  
    8787        return True
    8888
     89    '''
     90    Updates table and generates pspsuniqueids
     91    '''
     92   
     93    def updatePspsUniqueIDs(self):
     94        sql = "UPDATE ObjectThin join (select @r:=@r+1 rownum, objID from \
     95        (select @r:=0) r, ObjectThin t) as foo using (objID) set \
     96        uniquePspsP2id = ((" +str(self.batchID) "*1000000000 ) + rownum)";
     97        try: self.scratchDb.execute(sql)
     98        except:
     99            self.logger.errorPair('failed sql',sql)
     100            return
     101       
     102
     103   
    89104    '''
    90105    Applies indexes to the IPP tables
     
    429444        ##self.dvoObjects.purgeRegion(self.region)
    430445
     446        self.updatePspsUniqueIDs()
     447       
    431448        self.setMinMaxObjID(["ObjectThin"])
    432449
     
    439456        cptTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cpt")
    440457        cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
    441         self.logger.infoPair("Populating MeanObject from ", "ObjectThin")
    442 
    443         sql = "INSERT INTO MeanObject ( objID ) SELECT objID FROM ObjectThin"
     458        self.logger.infoPair("Populating MeanObject.objid and pspsUniqueOBid from ", "ObjectThin")
     459
     460        sql = "INSERT INTO MeanObject ( objID, pspsUniqueOBid ) SELECT objID, pspsUniqueOBid FROM ObjectThin"
    444461        try:
    445462            self.scratchDb.execute(sql)
     
    450467        self.logger.infoPair("Adding 'row' columns to", "MeanObject table")
    451468        self.scratchDb.addRowCountColumn("MeanObject", "row")
    452  
     469
     470
     471
     472       
    453473
    454474        ##self.scratchDb.addRowCountColumn(cpsTableName, "row")
Note: See TracChangeset for help on using the changeset viewer.