Index: trunk/ippToPsps/jython/objectbatch.py
===================================================================
--- trunk/ippToPsps/jython/objectbatch.py	(revision 33746)
+++ trunk/ippToPsps/jython/objectbatch.py	(revision 33760)
@@ -78,6 +78,10 @@
     def alterPspsTables(self):
 
+        # index objID column
         self.scratchDb.makeColumnUnique("Object", "objID")
 
+        # dec is reserved in MySQL, so STILTS replaces if with dec_, which PSPS doesn't like. so, force it back again
+        self.scratchDb.execute("ALTER TABLE Object CHANGE dec_ `dec` double")
+
         return True
 
@@ -97,5 +101,5 @@
 
         # list of all filters we are interested in
-        allFilters = ['g', 'r', 'i', 'z', 'y']
+        allFilters = ['g', 'r', 'i', 'z', 'y', ]
         
         # this loop looks into the DVO Photcodes tables and gets the 'CODE' for each the filters above that are listed
@@ -148,14 +152,14 @@
             self.logger.errorPair("Couldn't calculate colors", sql)
 
-
-    '''
-    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
-    '''
-    def populatePspsTables(self):
+    '''
+    Populates the Object table
+    '''
+    def populateObjectTable(self):
 
         cptTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cpt")
         cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps")
 
-        self.logger.infoPair("Inserting objects from", "cpt")
+        self.logger.infoPair("Populating", "ObjectCalColor")
+        self.logger.infoPair("Inserting objects from", "cpt file")
         sql = "INSERT IGNORE INTO Object (\
                objID \
@@ -164,8 +168,9 @@
                ,surveyID \
                ,ra \
-               ,dec_ \
+               ,`dec` \
                ,raErr \
                ,decErr \
                ,nDetections \
+               ,dataRelease \
                ) \
                SELECT \
@@ -179,4 +184,5 @@
                ,DEC_ERR \
                ,NMEASURE \
+               , " + str(self.config.dataRelease) + "\
                FROM " + cptTableName
 
@@ -185,4 +191,6 @@
         except:
             self.logger.errorPair("Couldn't populate Object table", sql)
+            return False
+
 
         # add row count columns so we can perform joins to get colors
@@ -206,2 +214,37 @@
         return True
 
+    '''
+    Populates the ObjectCalColor table
+    '''
+    def populateObjectCalColorTable(self):
+
+        self.logger.infoPair("Populating", "ObjectCalColor")
+
+        sql = "INSERT INTO ObjectCalColor ( \
+               objID \
+               ,ippObjID \
+               ,dataRelease \
+               ) \
+               SELECT \
+               objID \
+               ,ippObjID \
+               ,dataRelease \
+               FROM Object"
+        try:
+            self.scratchDb.execute(sql)
+        except:
+            self.logger.errorPair("Couldn't populate ObjectCalColor table", sql)
+            return False
+
+        return True
+
+    '''
+    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
+    '''
+    def populatePspsTables(self):
+
+        if not self.populateObjectTable(): return False
+        #if not self.populateObjectCalColorTable(): return False
+
+        return True
+
