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/stackbatch.py

    r37586 r37592  
    293293        self.generateRandomIDs()
    294294
    295         self.generateStackDetectRowIDs()
     295        self.generateStackDetectRowIDsAndPspsUniqueIDs()
    296296
    297297        # add indexes StackObjectThin
     
    944944
    945945    def generateRandomIDs(self):
    946         sql = "UPDATE StackObjectThin set randomStackObjID = FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)";
     946        sql = "UPDATE StackObjectThin set randomStackObjID = FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)"
    947947        try: self.scratchDb.execute(sql)
    948948        except:
     
    951951
    952952
    953     def generateStackDetectRowIDs(self):
     953    def generateStackDetectRowIDsAndPspsUniqueIDs(self):
    954954        sql = "UPDATE StackObjectThin join (select @r:=@r+1 rownum, objID from \
    955955        (select @r:=0) r, StackObjectThin t) as foo using (objID) set \
    956         stackDetectRowID = ((" + str(self.batchID) + " << 32 ) + rownum)";
     956        stackDetectRowID = ((" + str(self.batchID) + " << 32 ) + rownum), \
     957        uniquePspsSTid = ((" +str(self.batchID) "*1000000000 ) + rownum)";
    957958        try: self.scratchDb.execute(sql)
    958959        except:
     
    10111012            self.scratchDb.addColumn(table, filter + "haveData", "tinyint")
    10121013
    1013         fields = "objID, ippObjID, randomStackObjID, primaryDetection, bestDetection, "
     1014        fields = "objID, ippObjID, randomStackObjID, primaryDetection, bestDetection, uniquePspsSTID, "
    10141015
    10151016        for i in range(len(self.filters)):
Note: See TracChangeset for help on using the changeset viewer.