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

    r37577 r37592  
    224224        self.generateRandomIDs()
    225225
     226        self.generateUniquePspsIDs()
     227           
    226228        # add indexes ForcedWarpMeasurement
    227229        self.scratchDb.createIndex("ForcedWarpMeasurement", "objID")
     
    249251        self.tablesToExport.append("ForcedWarpExtended")
    250252
     253           # get dvo ids,
     254        # add in the psps unique ids from stuff
    251255
    252256    '''
     
    326330
    327331    def generateRandomIDs(self):
    328            sql = "UPDATE ForcedWarpMeasurement set randomWarpID = FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)";
     332           sql = "UPDATE ForcedWarpMeasurement set randomWarpID = FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)"
    329333        try: self.scratchDb.execute(sql)
    330334        except:
     
    333337
    334338
    335 
     339    '''
     340    Updates table and generates pspsuniqueids
     341    '''
     342
     343    def generatePspsUniqueIDs(self):
     344        sql = "UPDATE ForcedWarpMeasurement join (select @r:=@r+1 rownum, objID from \
     345        (select @r:=0) r, ForcedWarpMeasurement t) as foo using (objID) set \
     346        uniquePspsFWid = ((" +str(self.batchID)+ "*1000000000 ) + rownum)"
     347        try: self.scratchDb.execute(sql)
     348        except:
     349           self.logger.errorPair('failed sql',sql)
     350           return
     351           
    336352
    337353
Note: See TracChangeset for help on using the changeset viewer.