Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 11873)
+++ trunk/ippdb/src/ippdb.h	(revision 11988)
@@ -7493,7 +7493,7 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p4ScfileRow data structure
- *
- * Structure for representing a single row of p4Scfile table data.
+/** p4SkyfileRow data structure
+ *
+ * Structure for representing a single row of p4Skyfile table data.
  */
 
@@ -7502,22 +7502,18 @@
     char            *skycell_id;
     char            *tess_id;
-    char            *exp_tag;
-    psS32           p3_version;
     char            *uri;
     psF64           bg;
     psF64           bg_mean_stdev;
-} p4ScfileRow;
-
-/** Creates a new p4ScfileRow object
- *
- *  @return A new p4ScfileRow object or NULL on failure.
- */
-
-p4ScfileRow *p4ScfileRowAlloc(
+} p4SkyfileRow;
+
+/** Creates a new p4SkyfileRow object
+ *
+ *  @return A new p4SkyfileRow object or NULL on failure.
+ */
+
+p4SkyfileRow *p4SkyfileRowAlloc(
     psS32           p4_id,
     const char      *skycell_id,
     const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
     const char      *uri,
     psF64           bg,
@@ -7525,19 +7521,19 @@
 );
 
-/** Creates a new p4Scfile table
- *
- * @return true on success
- */
-
-bool p4ScfileCreateTable(
+/** Creates a new p4Skyfile table
+ *
+ * @return true on success
+ */
+
+bool p4SkyfileCreateTable(
     psDB            *dbh                ///< Database handle
 );
 
-/** Deletes a p4Scfile table
- *
- * @return true on success
- */
-
-bool p4ScfileDropTable(
+/** Deletes a p4Skyfile table
+ *
+ * @return true on success
+ */
+
+bool p4SkyfileDropTable(
     psDB            *dbh                ///< Database handle
 );
@@ -7550,11 +7546,9 @@
  */
 
-bool p4ScfileInsert(
+bool p4SkyfileInsert(
     psDB            *dbh,               ///< Database handle
     psS32           p4_id,
     const char      *skycell_id,
     const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
     const char      *uri,
     psF64           bg,
@@ -7567,5 +7561,5 @@
  */
 
-long long p4ScfileDelete(
+long long p4SkyfileDelete(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
@@ -7573,5 +7567,5 @@
 );
 
-/** Insert a single p4ScfileRow object into a table
+/** Insert a single p4SkyfileRow object into a table
  *
  * This function constructs and inserts a single row based on it's parameters.
@@ -7580,10 +7574,10 @@
  */
 
-bool p4ScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p4ScfileRow     *object             ///< p4ScfileRow object
-);
-
-/** Insert an array of p4ScfileRow object into a table
+bool p4SkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p4SkyfileRow    *object             ///< p4SkyfileRow object
+);
+
+/** Insert an array of p4SkyfileRow object into a table
  *
  * This function constructs and inserts multiple rows based on it's parameters.
@@ -7592,10 +7586,10 @@
  */
 
-bool p4ScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p4ScfileRow objects
-);
-
-/** Insert data from a binary FITS table p4ScfileRow into the database
+bool p4SkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p4SkyfileRow objects
+);
+
+/** Insert data from a binary FITS table p4SkyfileRow into the database
  *
  * This function expects a psFits object with a FITS table as the first
@@ -7607,5 +7601,5 @@
  */
 
-bool p4ScfileInsertFits(
+bool p4SkyfileInsertFits(
     psDB            *dbh,               ///< Database handle
     const psFits    *fits               ///< psFits object
@@ -7622,5 +7616,5 @@
  */
 
-bool p4ScfileSelectRowsFits(
+bool p4SkyfileSelectRowsFits(
     psDB            *dbh,               ///< Database handle
     psFits          *fits,              ///< psFits object
@@ -7629,22 +7623,22 @@
 );
 
-/** Convert a p4ScfileRow into an equivalent psMetadata
+/** Convert a p4SkyfileRow into an equivalent psMetadata
  *
  * @return A psMetadata pointer or NULL on error
  */
 
-psMetadata *p4ScfileMetadataFromObject(
-    const p4ScfileRow *object             ///< fooRow to convert into a psMetadata
+psMetadata *p4SkyfileMetadataFromObject(
+    const p4SkyfileRow *object             ///< fooRow to convert into a psMetadata
 );
 
 /** Convert a psMetadata into an equivalent fooRow
  *
- * @return A p4ScfileRow pointer or NULL on error
- */
-
-p4ScfileRow *p4ScfileObjectFromMetadata(
+ * @return A p4SkyfileRow pointer or NULL on error
+ */
+
+p4SkyfileRow *p4SkyfileObjectFromMetadata(
     psMetadata      *md                 ///< psMetadata to convert into a fooRow
 );
-/** Selects up to limit rows from the database and returns as p4ScfileRow objects in a psArray
+/** Selects up to limit rows from the database and returns as p4SkyfileRow objects in a psArray
  *
  *  See psDBSelectRows() for documentation on the format of where.
@@ -7653,10 +7647,10 @@
  */
 
-psArray *p4ScfileSelectRowObjects(
+psArray *p4SkyfileSelectRowObjects(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
     unsigned long long limit            ///< Maximum number of elements to return
 );
-/** Deletes a row from the database coresponding to an p4Scfile
+/** Deletes a row from the database coresponding to an p4Skyfile
  *
  *  Note that a 'where' search psMetadata is constructed from each object and
@@ -7666,7 +7660,7 @@
  */
 
-bool p4ScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p4ScfileRow *object    ///< Object to delete
+bool p4SkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p4SkyfileRow *object    ///< Object to delete
 );
 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
@@ -7678,10 +7672,10 @@
  */
 
-long long p4ScfileDeleteRowObjects(
+long long p4SkyfileDeleteRowObjects(
     psDB            *dbh,               ///< Database handle
     const psArray   *objects,           ///< Array of objects to delete
     unsigned long long limit            ///< Maximum number of elements to delete 
 );
-/** Formats and prints an array of p4ScfileRow objects
+/** Formats and prints an array of p4SkyfileRow objects
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -7691,10 +7685,10 @@
  */
 
-bool p4ScfilePrintObjects(
+bool p4SkyfilePrintObjects(
     FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p4ScfileRow objects
+    psArray         *objects,           ///< An array of p4SkyfileRow objects
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** Formats and prints an p4ScfileRow object
+/** Formats and prints an p4SkyfileRow object
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -7704,7 +7698,7 @@
  */
 
-bool p4ScfilePrintObject(
+bool p4SkyfilePrintObject(
     FILE            *stream,            ///< a stream
-    p4ScfileRow *object,    ///< an p4ScfileRow object
+    p4SkyfileRow *object,    ///< an p4SkyfileRow object
     bool            mdcf                ///< format as mdconfig or simple
 );
@@ -7720,4 +7714,6 @@
     char            *dvodb;
     psTime*         registered;
+    char            *skycell_id;
+    char            *tess_id;
 } p5RunRow;
 
@@ -7732,5 +7728,7 @@
     const char      *workdir,
     const char      *dvodb,
-    psTime*         registered
+    psTime*         registered,
+    const char      *skycell_id,
+    const char      *tess_id
 );
 
@@ -7766,5 +7764,7 @@
     const char      *workdir,
     const char      *dvodb,
-    psTime*         registered
+    psTime*         registered,
+    const char      *skycell_id,
+    const char      *tess_id
 );
 
@@ -7916,7 +7916,7 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p5InputScfileRow data structure
- *
- * Structure for representing a single row of p5InputScfile table data.
+/** p5InputSkyfileRow data structure
+ *
+ * Structure for representing a single row of p5InputSkyfile table data.
  */
 
@@ -7928,12 +7928,12 @@
     char            *kind;
     bool            template;
-} p5InputScfileRow;
-
-/** Creates a new p5InputScfileRow object
- *
- *  @return A new p5InputScfileRow object or NULL on failure.
- */
-
-p5InputScfileRow *p5InputScfileRowAlloc(
+} p5InputSkyfileRow;
+
+/** Creates a new p5InputSkyfileRow object
+ *
+ *  @return A new p5InputSkyfileRow object or NULL on failure.
+ */
+
+p5InputSkyfileRow *p5InputSkyfileRowAlloc(
     psS32           p5_id,
     psS32           p4_id,
@@ -7944,19 +7944,19 @@
 );
 
-/** Creates a new p5InputScfile table
- *
- * @return true on success
- */
-
-bool p5InputScfileCreateTable(
+/** Creates a new p5InputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p5InputSkyfileCreateTable(
     psDB            *dbh                ///< Database handle
 );
 
-/** Deletes a p5InputScfile table
- *
- * @return true on success
- */
-
-bool p5InputScfileDropTable(
+/** Deletes a p5InputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p5InputSkyfileDropTable(
     psDB            *dbh                ///< Database handle
 );
@@ -7969,5 +7969,5 @@
  */
 
-bool p5InputScfileInsert(
+bool p5InputSkyfileInsert(
     psDB            *dbh,               ///< Database handle
     psS32           p5_id,
@@ -7984,5 +7984,5 @@
  */
 
-long long p5InputScfileDelete(
+long long p5InputSkyfileDelete(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
@@ -7990,5 +7990,5 @@
 );
 
-/** Insert a single p5InputScfileRow object into a table
+/** Insert a single p5InputSkyfileRow object into a table
  *
  * This function constructs and inserts a single row based on it's parameters.
@@ -7997,10 +7997,10 @@
  */
 
-bool p5InputScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p5InputScfileRow *object             ///< p5InputScfileRow object
-);
-
-/** Insert an array of p5InputScfileRow object into a table
+bool p5InputSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p5InputSkyfileRow *object             ///< p5InputSkyfileRow object
+);
+
+/** Insert an array of p5InputSkyfileRow object into a table
  *
  * This function constructs and inserts multiple rows based on it's parameters.
@@ -8009,10 +8009,10 @@
  */
 
-bool p5InputScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p5InputScfileRow objects
-);
-
-/** Insert data from a binary FITS table p5InputScfileRow into the database
+bool p5InputSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p5InputSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table p5InputSkyfileRow into the database
  *
  * This function expects a psFits object with a FITS table as the first
@@ -8024,5 +8024,5 @@
  */
 
-bool p5InputScfileInsertFits(
+bool p5InputSkyfileInsertFits(
     psDB            *dbh,               ///< Database handle
     const psFits    *fits               ///< psFits object
@@ -8039,5 +8039,5 @@
  */
 
-bool p5InputScfileSelectRowsFits(
+bool p5InputSkyfileSelectRowsFits(
     psDB            *dbh,               ///< Database handle
     psFits          *fits,              ///< psFits object
@@ -8046,22 +8046,22 @@
 );
 
-/** Convert a p5InputScfileRow into an equivalent psMetadata
+/** Convert a p5InputSkyfileRow into an equivalent psMetadata
  *
  * @return A psMetadata pointer or NULL on error
  */
 
-psMetadata *p5InputScfileMetadataFromObject(
-    const p5InputScfileRow *object             ///< fooRow to convert into a psMetadata
+psMetadata *p5InputSkyfileMetadataFromObject(
+    const p5InputSkyfileRow *object             ///< fooRow to convert into a psMetadata
 );
 
 /** Convert a psMetadata into an equivalent fooRow
  *
- * @return A p5InputScfileRow pointer or NULL on error
- */
-
-p5InputScfileRow *p5InputScfileObjectFromMetadata(
+ * @return A p5InputSkyfileRow pointer or NULL on error
+ */
+
+p5InputSkyfileRow *p5InputSkyfileObjectFromMetadata(
     psMetadata      *md                 ///< psMetadata to convert into a fooRow
 );
-/** Selects up to limit rows from the database and returns as p5InputScfileRow objects in a psArray
+/** Selects up to limit rows from the database and returns as p5InputSkyfileRow objects in a psArray
  *
  *  See psDBSelectRows() for documentation on the format of where.
@@ -8070,10 +8070,10 @@
  */
 
-psArray *p5InputScfileSelectRowObjects(
+psArray *p5InputSkyfileSelectRowObjects(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
     unsigned long long limit            ///< Maximum number of elements to return
 );
-/** Deletes a row from the database coresponding to an p5InputScfile
+/** Deletes a row from the database coresponding to an p5InputSkyfile
  *
  *  Note that a 'where' search psMetadata is constructed from each object and
@@ -8083,7 +8083,7 @@
  */
 
-bool p5InputScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p5InputScfileRow *object    ///< Object to delete
+bool p5InputSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p5InputSkyfileRow *object    ///< Object to delete
 );
 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
@@ -8095,10 +8095,10 @@
  */
 
-long long p5InputScfileDeleteRowObjects(
+long long p5InputSkyfileDeleteRowObjects(
     psDB            *dbh,               ///< Database handle
     const psArray   *objects,           ///< Array of objects to delete
     unsigned long long limit            ///< Maximum number of elements to delete 
 );
-/** Formats and prints an array of p5InputScfileRow objects
+/** Formats and prints an array of p5InputSkyfileRow objects
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8108,10 +8108,10 @@
  */
 
-bool p5InputScfilePrintObjects(
+bool p5InputSkyfilePrintObjects(
     FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p5InputScfileRow objects
+    psArray         *objects,           ///< An array of p5InputSkyfileRow objects
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** Formats and prints an p5InputScfileRow object
+/** Formats and prints an p5InputSkyfileRow object
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8121,32 +8121,28 @@
  */
 
-bool p5InputScfilePrintObject(
+bool p5InputSkyfilePrintObject(
     FILE            *stream,            ///< a stream
-    p5InputScfileRow *object,    ///< an p5InputScfileRow object
+    p5InputSkyfileRow *object,    ///< an p5InputSkyfileRow object
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p5DiffScfileRow data structure
- *
- * Structure for representing a single row of p5DiffScfile table data.
+/** p5DiffSkyfileRow data structure
+ *
+ * Structure for representing a single row of p5DiffSkyfile table data.
  */
 
 typedef struct {
     psS32           p5_id;
-    char            *skycell_id;
-    char            *tess_id;
     char            *uri;
     psF64           bg;
     psF64           bg_mean_stdev;
-} p5DiffScfileRow;
-
-/** Creates a new p5DiffScfileRow object
- *
- *  @return A new p5DiffScfileRow object or NULL on failure.
- */
-
-p5DiffScfileRow *p5DiffScfileRowAlloc(
+} p5DiffSkyfileRow;
+
+/** Creates a new p5DiffSkyfileRow object
+ *
+ *  @return A new p5DiffSkyfileRow object or NULL on failure.
+ */
+
+p5DiffSkyfileRow *p5DiffSkyfileRowAlloc(
     psS32           p5_id,
-    const char      *skycell_id,
-    const char      *tess_id,
     const char      *uri,
     psF64           bg,
@@ -8154,19 +8150,19 @@
 );
 
-/** Creates a new p5DiffScfile table
- *
- * @return true on success
- */
-
-bool p5DiffScfileCreateTable(
+/** Creates a new p5DiffSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p5DiffSkyfileCreateTable(
     psDB            *dbh                ///< Database handle
 );
 
-/** Deletes a p5DiffScfile table
- *
- * @return true on success
- */
-
-bool p5DiffScfileDropTable(
+/** Deletes a p5DiffSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p5DiffSkyfileDropTable(
     psDB            *dbh                ///< Database handle
 );
@@ -8179,9 +8175,7 @@
  */
 
-bool p5DiffScfileInsert(
+bool p5DiffSkyfileInsert(
     psDB            *dbh,               ///< Database handle
     psS32           p5_id,
-    const char      *skycell_id,
-    const char      *tess_id,
     const char      *uri,
     psF64           bg,
@@ -8194,5 +8188,5 @@
  */
 
-long long p5DiffScfileDelete(
+long long p5DiffSkyfileDelete(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
@@ -8200,5 +8194,5 @@
 );
 
-/** Insert a single p5DiffScfileRow object into a table
+/** Insert a single p5DiffSkyfileRow object into a table
  *
  * This function constructs and inserts a single row based on it's parameters.
@@ -8207,10 +8201,10 @@
  */
 
-bool p5DiffScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p5DiffScfileRow *object             ///< p5DiffScfileRow object
-);
-
-/** Insert an array of p5DiffScfileRow object into a table
+bool p5DiffSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p5DiffSkyfileRow *object             ///< p5DiffSkyfileRow object
+);
+
+/** Insert an array of p5DiffSkyfileRow object into a table
  *
  * This function constructs and inserts multiple rows based on it's parameters.
@@ -8219,10 +8213,10 @@
  */
 
-bool p5DiffScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p5DiffScfileRow objects
-);
-
-/** Insert data from a binary FITS table p5DiffScfileRow into the database
+bool p5DiffSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p5DiffSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table p5DiffSkyfileRow into the database
  *
  * This function expects a psFits object with a FITS table as the first
@@ -8234,5 +8228,5 @@
  */
 
-bool p5DiffScfileInsertFits(
+bool p5DiffSkyfileInsertFits(
     psDB            *dbh,               ///< Database handle
     const psFits    *fits               ///< psFits object
@@ -8249,5 +8243,5 @@
  */
 
-bool p5DiffScfileSelectRowsFits(
+bool p5DiffSkyfileSelectRowsFits(
     psDB            *dbh,               ///< Database handle
     psFits          *fits,              ///< psFits object
@@ -8256,22 +8250,22 @@
 );
 
-/** Convert a p5DiffScfileRow into an equivalent psMetadata
+/** Convert a p5DiffSkyfileRow into an equivalent psMetadata
  *
  * @return A psMetadata pointer or NULL on error
  */
 
-psMetadata *p5DiffScfileMetadataFromObject(
-    const p5DiffScfileRow *object             ///< fooRow to convert into a psMetadata
+psMetadata *p5DiffSkyfileMetadataFromObject(
+    const p5DiffSkyfileRow *object             ///< fooRow to convert into a psMetadata
 );
 
 /** Convert a psMetadata into an equivalent fooRow
  *
- * @return A p5DiffScfileRow pointer or NULL on error
- */
-
-p5DiffScfileRow *p5DiffScfileObjectFromMetadata(
+ * @return A p5DiffSkyfileRow pointer or NULL on error
+ */
+
+p5DiffSkyfileRow *p5DiffSkyfileObjectFromMetadata(
     psMetadata      *md                 ///< psMetadata to convert into a fooRow
 );
-/** Selects up to limit rows from the database and returns as p5DiffScfileRow objects in a psArray
+/** Selects up to limit rows from the database and returns as p5DiffSkyfileRow objects in a psArray
  *
  *  See psDBSelectRows() for documentation on the format of where.
@@ -8280,10 +8274,10 @@
  */
 
-psArray *p5DiffScfileSelectRowObjects(
+psArray *p5DiffSkyfileSelectRowObjects(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
     unsigned long long limit            ///< Maximum number of elements to return
 );
-/** Deletes a row from the database coresponding to an p5DiffScfile
+/** Deletes a row from the database coresponding to an p5DiffSkyfile
  *
  *  Note that a 'where' search psMetadata is constructed from each object and
@@ -8293,7 +8287,7 @@
  */
 
-bool p5DiffScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p5DiffScfileRow *object    ///< Object to delete
+bool p5DiffSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p5DiffSkyfileRow *object    ///< Object to delete
 );
 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
@@ -8305,10 +8299,10 @@
  */
 
-long long p5DiffScfileDeleteRowObjects(
+long long p5DiffSkyfileDeleteRowObjects(
     psDB            *dbh,               ///< Database handle
     const psArray   *objects,           ///< Array of objects to delete
     unsigned long long limit            ///< Maximum number of elements to delete 
 );
-/** Formats and prints an array of p5DiffScfileRow objects
+/** Formats and prints an array of p5DiffSkyfileRow objects
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8318,10 +8312,10 @@
  */
 
-bool p5DiffScfilePrintObjects(
+bool p5DiffSkyfilePrintObjects(
     FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p5DiffScfileRow objects
+    psArray         *objects,           ///< An array of p5DiffSkyfileRow objects
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** Formats and prints an p5DiffScfileRow object
+/** Formats and prints an p5DiffSkyfileRow object
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8331,7 +8325,7 @@
  */
 
-bool p5DiffScfilePrintObject(
+bool p5DiffSkyfilePrintObject(
     FILE            *stream,            ///< a stream
-    p5DiffScfileRow *object,    ///< an p5DiffScfileRow object
+    p5DiffSkyfileRow *object,    ///< an p5DiffSkyfileRow object
     bool            mdcf                ///< format as mdconfig or simple
 );
@@ -8347,4 +8341,6 @@
     char            *dvodb;
     psTime*         registered;
+    char            *skycell_id;
+    char            *tess_id;
 } p6RunRow;
 
@@ -8359,5 +8355,7 @@
     const char      *workdir,
     const char      *dvodb,
-    psTime*         registered
+    psTime*         registered,
+    const char      *skycell_id,
+    const char      *tess_id
 );
 
@@ -8393,5 +8391,7 @@
     const char      *workdir,
     const char      *dvodb,
-    psTime*         registered
+    psTime*         registered,
+    const char      *skycell_id,
+    const char      *tess_id
 );
 
@@ -8543,7 +8543,7 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p6InputScfileRow data structure
- *
- * Structure for representing a single row of p6InputScfile table data.
+/** p6InputSkyfileRow data structure
+ *
+ * Structure for representing a single row of p6InputSkyfile table data.
  */
 
@@ -8551,35 +8551,31 @@
     psS32           p6_id;
     psS32           p4_id;
-    char            *skycell_id;
-    char            *tess_id;
-} p6InputScfileRow;
-
-/** Creates a new p6InputScfileRow object
- *
- *  @return A new p6InputScfileRow object or NULL on failure.
- */
-
-p6InputScfileRow *p6InputScfileRowAlloc(
+} p6InputSkyfileRow;
+
+/** Creates a new p6InputSkyfileRow object
+ *
+ *  @return A new p6InputSkyfileRow object or NULL on failure.
+ */
+
+p6InputSkyfileRow *p6InputSkyfileRowAlloc(
     psS32           p6_id,
-    psS32           p4_id,
-    const char      *skycell_id,
-    const char      *tess_id
-);
-
-/** Creates a new p6InputScfile table
- *
- * @return true on success
- */
-
-bool p6InputScfileCreateTable(
+    psS32           p4_id
+);
+
+/** Creates a new p6InputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p6InputSkyfileCreateTable(
     psDB            *dbh                ///< Database handle
 );
 
-/** Deletes a p6InputScfile table
- *
- * @return true on success
- */
-
-bool p6InputScfileDropTable(
+/** Deletes a p6InputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p6InputSkyfileDropTable(
     psDB            *dbh                ///< Database handle
 );
@@ -8592,10 +8588,8 @@
  */
 
-bool p6InputScfileInsert(
+bool p6InputSkyfileInsert(
     psDB            *dbh,               ///< Database handle
     psS32           p6_id,
-    psS32           p4_id,
-    const char      *skycell_id,
-    const char      *tess_id
+    psS32           p4_id
 );
 
@@ -8605,5 +8599,5 @@
  */
 
-long long p6InputScfileDelete(
+long long p6InputSkyfileDelete(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
@@ -8611,5 +8605,5 @@
 );
 
-/** Insert a single p6InputScfileRow object into a table
+/** Insert a single p6InputSkyfileRow object into a table
  *
  * This function constructs and inserts a single row based on it's parameters.
@@ -8618,10 +8612,10 @@
  */
 
-bool p6InputScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p6InputScfileRow *object             ///< p6InputScfileRow object
-);
-
-/** Insert an array of p6InputScfileRow object into a table
+bool p6InputSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p6InputSkyfileRow *object             ///< p6InputSkyfileRow object
+);
+
+/** Insert an array of p6InputSkyfileRow object into a table
  *
  * This function constructs and inserts multiple rows based on it's parameters.
@@ -8630,10 +8624,10 @@
  */
 
-bool p6InputScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p6InputScfileRow objects
-);
-
-/** Insert data from a binary FITS table p6InputScfileRow into the database
+bool p6InputSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p6InputSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table p6InputSkyfileRow into the database
  *
  * This function expects a psFits object with a FITS table as the first
@@ -8645,5 +8639,5 @@
  */
 
-bool p6InputScfileInsertFits(
+bool p6InputSkyfileInsertFits(
     psDB            *dbh,               ///< Database handle
     const psFits    *fits               ///< psFits object
@@ -8660,5 +8654,5 @@
  */
 
-bool p6InputScfileSelectRowsFits(
+bool p6InputSkyfileSelectRowsFits(
     psDB            *dbh,               ///< Database handle
     psFits          *fits,              ///< psFits object
@@ -8667,22 +8661,22 @@
 );
 
-/** Convert a p6InputScfileRow into an equivalent psMetadata
+/** Convert a p6InputSkyfileRow into an equivalent psMetadata
  *
  * @return A psMetadata pointer or NULL on error
  */
 
-psMetadata *p6InputScfileMetadataFromObject(
-    const p6InputScfileRow *object             ///< fooRow to convert into a psMetadata
+psMetadata *p6InputSkyfileMetadataFromObject(
+    const p6InputSkyfileRow *object             ///< fooRow to convert into a psMetadata
 );
 
 /** Convert a psMetadata into an equivalent fooRow
  *
- * @return A p6InputScfileRow pointer or NULL on error
- */
-
-p6InputScfileRow *p6InputScfileObjectFromMetadata(
+ * @return A p6InputSkyfileRow pointer or NULL on error
+ */
+
+p6InputSkyfileRow *p6InputSkyfileObjectFromMetadata(
     psMetadata      *md                 ///< psMetadata to convert into a fooRow
 );
-/** Selects up to limit rows from the database and returns as p6InputScfileRow objects in a psArray
+/** Selects up to limit rows from the database and returns as p6InputSkyfileRow objects in a psArray
  *
  *  See psDBSelectRows() for documentation on the format of where.
@@ -8691,10 +8685,10 @@
  */
 
-psArray *p6InputScfileSelectRowObjects(
+psArray *p6InputSkyfileSelectRowObjects(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
     unsigned long long limit            ///< Maximum number of elements to return
 );
-/** Deletes a row from the database coresponding to an p6InputScfile
+/** Deletes a row from the database coresponding to an p6InputSkyfile
  *
  *  Note that a 'where' search psMetadata is constructed from each object and
@@ -8704,7 +8698,7 @@
  */
 
-bool p6InputScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p6InputScfileRow *object    ///< Object to delete
+bool p6InputSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p6InputSkyfileRow *object    ///< Object to delete
 );
 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
@@ -8716,10 +8710,10 @@
  */
 
-long long p6InputScfileDeleteRowObjects(
+long long p6InputSkyfileDeleteRowObjects(
     psDB            *dbh,               ///< Database handle
     const psArray   *objects,           ///< Array of objects to delete
     unsigned long long limit            ///< Maximum number of elements to delete 
 );
-/** Formats and prints an array of p6InputScfileRow objects
+/** Formats and prints an array of p6InputSkyfileRow objects
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8729,10 +8723,10 @@
  */
 
-bool p6InputScfilePrintObjects(
+bool p6InputSkyfilePrintObjects(
     FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p6InputScfileRow objects
+    psArray         *objects,           ///< An array of p6InputSkyfileRow objects
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** Formats and prints an p6InputScfileRow object
+/** Formats and prints an p6InputSkyfileRow object
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8742,32 +8736,28 @@
  */
 
-bool p6InputScfilePrintObject(
+bool p6InputSkyfilePrintObject(
     FILE            *stream,            ///< a stream
-    p6InputScfileRow *object,    ///< an p6InputScfileRow object
+    p6InputSkyfileRow *object,    ///< an p6InputSkyfileRow object
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p6SumScfileRow data structure
- *
- * Structure for representing a single row of p6SumScfile table data.
+/** p6SumSkyfileRow data structure
+ *
+ * Structure for representing a single row of p6SumSkyfile table data.
  */
 
 typedef struct {
     psS32           p6_id;
-    char            *skycell_id;
-    char            *tess_id;
     char            *uri;
     psF64           bg;
     psF64           bg_mean_stdev;
-} p6SumScfileRow;
-
-/** Creates a new p6SumScfileRow object
- *
- *  @return A new p6SumScfileRow object or NULL on failure.
- */
-
-p6SumScfileRow *p6SumScfileRowAlloc(
+} p6SumSkyfileRow;
+
+/** Creates a new p6SumSkyfileRow object
+ *
+ *  @return A new p6SumSkyfileRow object or NULL on failure.
+ */
+
+p6SumSkyfileRow *p6SumSkyfileRowAlloc(
     psS32           p6_id,
-    const char      *skycell_id,
-    const char      *tess_id,
     const char      *uri,
     psF64           bg,
@@ -8775,19 +8765,19 @@
 );
 
-/** Creates a new p6SumScfile table
- *
- * @return true on success
- */
-
-bool p6SumScfileCreateTable(
+/** Creates a new p6SumSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p6SumSkyfileCreateTable(
     psDB            *dbh                ///< Database handle
 );
 
-/** Deletes a p6SumScfile table
- *
- * @return true on success
- */
-
-bool p6SumScfileDropTable(
+/** Deletes a p6SumSkyfile table
+ *
+ * @return true on success
+ */
+
+bool p6SumSkyfileDropTable(
     psDB            *dbh                ///< Database handle
 );
@@ -8800,9 +8790,7 @@
  */
 
-bool p6SumScfileInsert(
+bool p6SumSkyfileInsert(
     psDB            *dbh,               ///< Database handle
     psS32           p6_id,
-    const char      *skycell_id,
-    const char      *tess_id,
     const char      *uri,
     psF64           bg,
@@ -8815,5 +8803,5 @@
  */
 
-long long p6SumScfileDelete(
+long long p6SumSkyfileDelete(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
@@ -8821,5 +8809,5 @@
 );
 
-/** Insert a single p6SumScfileRow object into a table
+/** Insert a single p6SumSkyfileRow object into a table
  *
  * This function constructs and inserts a single row based on it's parameters.
@@ -8828,10 +8816,10 @@
  */
 
-bool p6SumScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p6SumScfileRow  *object             ///< p6SumScfileRow object
-);
-
-/** Insert an array of p6SumScfileRow object into a table
+bool p6SumSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p6SumSkyfileRow *object             ///< p6SumSkyfileRow object
+);
+
+/** Insert an array of p6SumSkyfileRow object into a table
  *
  * This function constructs and inserts multiple rows based on it's parameters.
@@ -8840,10 +8828,10 @@
  */
 
-bool p6SumScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p6SumScfileRow objects
-);
-
-/** Insert data from a binary FITS table p6SumScfileRow into the database
+bool p6SumSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p6SumSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table p6SumSkyfileRow into the database
  *
  * This function expects a psFits object with a FITS table as the first
@@ -8855,5 +8843,5 @@
  */
 
-bool p6SumScfileInsertFits(
+bool p6SumSkyfileInsertFits(
     psDB            *dbh,               ///< Database handle
     const psFits    *fits               ///< psFits object
@@ -8870,5 +8858,5 @@
  */
 
-bool p6SumScfileSelectRowsFits(
+bool p6SumSkyfileSelectRowsFits(
     psDB            *dbh,               ///< Database handle
     psFits          *fits,              ///< psFits object
@@ -8877,22 +8865,22 @@
 );
 
-/** Convert a p6SumScfileRow into an equivalent psMetadata
+/** Convert a p6SumSkyfileRow into an equivalent psMetadata
  *
  * @return A psMetadata pointer or NULL on error
  */
 
-psMetadata *p6SumScfileMetadataFromObject(
-    const p6SumScfileRow *object             ///< fooRow to convert into a psMetadata
+psMetadata *p6SumSkyfileMetadataFromObject(
+    const p6SumSkyfileRow *object             ///< fooRow to convert into a psMetadata
 );
 
 /** Convert a psMetadata into an equivalent fooRow
  *
- * @return A p6SumScfileRow pointer or NULL on error
- */
-
-p6SumScfileRow *p6SumScfileObjectFromMetadata(
+ * @return A p6SumSkyfileRow pointer or NULL on error
+ */
+
+p6SumSkyfileRow *p6SumSkyfileObjectFromMetadata(
     psMetadata      *md                 ///< psMetadata to convert into a fooRow
 );
-/** Selects up to limit rows from the database and returns as p6SumScfileRow objects in a psArray
+/** Selects up to limit rows from the database and returns as p6SumSkyfileRow objects in a psArray
  *
  *  See psDBSelectRows() for documentation on the format of where.
@@ -8901,10 +8889,10 @@
  */
 
-psArray *p6SumScfileSelectRowObjects(
+psArray *p6SumSkyfileSelectRowObjects(
     psDB            *dbh,               ///< Database handle
     const psMetadata *where,            ///< Row match criteria
     unsigned long long limit            ///< Maximum number of elements to return
 );
-/** Deletes a row from the database coresponding to an p6SumScfile
+/** Deletes a row from the database coresponding to an p6SumSkyfile
  *
  *  Note that a 'where' search psMetadata is constructed from each object and
@@ -8914,7 +8902,7 @@
  */
 
-bool p6SumScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p6SumScfileRow *object    ///< Object to delete
+bool p6SumSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p6SumSkyfileRow *object    ///< Object to delete
 );
 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
@@ -8926,10 +8914,10 @@
  */
 
-long long p6SumScfileDeleteRowObjects(
+long long p6SumSkyfileDeleteRowObjects(
     psDB            *dbh,               ///< Database handle
     const psArray   *objects,           ///< Array of objects to delete
     unsigned long long limit            ///< Maximum number of elements to delete 
 );
-/** Formats and prints an array of p6SumScfileRow objects
+/** Formats and prints an array of p6SumSkyfileRow objects
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8939,10 +8927,10 @@
  */
 
-bool p6SumScfilePrintObjects(
+bool p6SumSkyfilePrintObjects(
     FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p6SumScfileRow objects
+    psArray         *objects,           ///< An array of p6SumSkyfileRow objects
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** Formats and prints an p6SumScfileRow object
+/** Formats and prints an p6SumSkyfileRow object
  *
  * When mdcf is set the formated output is in psMetadataConfig
@@ -8952,7 +8940,7 @@
  */
 
-bool p6SumScfilePrintObject(
+bool p6SumSkyfilePrintObject(
     FILE            *stream,            ///< a stream
-    p6SumScfileRow *object,    ///< an p6SumScfileRow object
+    p6SumSkyfileRow *object,    ///< an p6SumSkyfileRow object
     bool            mdcf                ///< format as mdconfig or simple
 );
@@ -8964,3 +8952,3 @@
 #endif
 
-#endif // P6SUMSCFILE_DB_H
+#endif // P6SUMSKYFILE_DB_H
