Index: /branches/pap_mops/dbconfig/changes.txt
===================================================================
--- /branches/pap_mops/dbconfig/changes.txt	(revision 24427)
+++ /branches/pap_mops/dbconfig/changes.txt	(revision 24428)
@@ -1128,11 +1128,12 @@
 
 -- Tables to support publishing of detections to a Science Client
+
 -- Clients to which we send stuff
 CREATE TABLE publishClient (
     client_id BIGINT AUTO_INCREMENT, -- unique identifier
+    product VARCHAR(64),             -- product name
+    stage VARCHAR(64) NOT NULL, -- stage of interest (chip, camera, diff, etc.)
+    workdir VARCHAR(255) NOT NULL, -- working directory
     comment VARCHAR(255),            -- for human memory
-    stage VARCHAR(64) NOT NULL, -- stage of interest (chip, camera, diff, etc.)
-    format VARCHAR(64),              -- format of data
-    destination VARCHAR(255) NOT NULL, -- where to send data
     PRIMARY KEY(client_id)
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
@@ -1152,11 +1153,11 @@
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
 -- Publishing a file within a set
-CREATE TABLE publishFile (
+CREATE TABLE publishDone (
     pub_id BIGINT AUTO_INCREMENT, -- link to publishRun
-    component VARCHAR(64),        -- analagous to class_id or skycell_id
+    path_base VARCHAR(255),     -- base path of output
     fault SMALLINT NOT NULL DEFAULT 0, -- Fault code
-    PRIMARY KEY(pub_id, component),
-    KEY(component),
+    PRIMARY KEY(pub_id),
     KEY(fault),
     FOREIGN KEY(pub_id) REFERENCES publishRun(pub_id)
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
+
Index: /branches/pap_mops/dbconfig/publish.md
===================================================================
--- /branches/pap_mops/dbconfig/publish.md	(revision 24427)
+++ /branches/pap_mops/dbconfig/publish.md	(revision 24428)
@@ -5,4 +5,5 @@
     product     STR	    64
     stage	STR	    64
+    workdir     STR	    255
     comment     STR         255
 END
@@ -12,5 +13,4 @@
     client_id   S64         0
     stage_id    S64         0
-    workdir     STR	    255
     label       STR         64
     state       STR         64
Index: /branches/pap_mops/ippTools/doc/publish_flow.txt
===================================================================
--- /branches/pap_mops/ippTools/doc/publish_flow.txt	(revision 24427)
+++ /branches/pap_mops/ippTools/doc/publish_flow.txt	(revision 24428)
@@ -1,7 +1,7 @@
 ### Setup
-pubtool -defineclient -stage diff -comment Comment -destination DataStore -format MOPS
+pubtool -defineclient -stage diff -comment Comment -product IPP-MOPS -workdir /path/to/somewhere
 
 ### Regularly run by pantasks to generate publishing runs based on data that has been processed
-pubtool -definerun -workdir /path/to/somewhere
+pubtool -definerun
 
 ### Regularly run by pantasks to get list of files to publish
Index: /branches/pap_mops/ippTools/share/pubtool_pending.sql
===================================================================
--- /branches/pap_mops/ippTools/share/pubtool_pending.sql	(revision 24427)
+++ /branches/pap_mops/ippTools/share/pubtool_pending.sql	(revision 24428)
@@ -6,6 +6,6 @@
         publishClient.product,
         publishClient.stage,
-        diffRun.diff_id AS stage_id,
-        publishRun.workdir
+        publishClient.workdir,
+        diffRun.diff_id AS stage_id
     FROM publishRun
     JOIN publishClient USING(client_id)
@@ -21,6 +21,6 @@
         publishClient.product,
         publishClient.stage,
-        camRun.cam_id AS stage_id,
-        publishRun.workdir
+        publishClient.workdir,
+        camRun.cam_id AS stage_id
     FROM publishRun
     JOIN publishClient USING(client_id)
Index: /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql	(revision 24427)
+++ /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql	(revision 24428)
@@ -1376,4 +1376,5 @@
     product VARCHAR(64),             -- product name
     stage VARCHAR(64) NOT NULL, -- stage of interest (chip, camera, diff, etc.)
+    workdir VARCHAR(255) NOT NULL, -- working directory
     comment VARCHAR(255),            -- for human memory
     PRIMARY KEY(client_id)
@@ -1385,5 +1386,4 @@
     client_id BIGINT NOT NULL,  -- link to publishClient
     stage_id BIGINT NOT NULL,   -- link to various stage tables
-    workdir VARCHAR(255) NOT NULL, -- working directory
     label VARCHAR(64),          -- label for run
     state VARCHAR(64),          -- state of run (new, full, etc.)
Index: /branches/pap_mops/ippTools/src/pubtool.c
===================================================================
--- /branches/pap_mops/ippTools/src/pubtool.c	(revision 24427)
+++ /branches/pap_mops/ippTools/src/pubtool.c	(revision 24428)
@@ -89,9 +89,10 @@
     PXOPT_LOOKUP_STR(product, config->args, "-product",  true, false);
     PXOPT_LOOKUP_STR(stage, config->args, "-stage", true, false);
+    PXOPT_LOOKUP_STR(workdir, config->args, "-workdir",  true, false);
 
     // optional
     PXOPT_LOOKUP_STR(comment, config->args, "-comment",  false, false);
 
-    if (!publishClientInsert(config->dbh, 0, product, stage, comment)) {
+    if (!publishClientInsert(config->dbh, 0, product, stage, workdir, comment)) {
         psError(PS_ERR_UNKNOWN, false, "Database error");
         return false;
@@ -108,5 +109,4 @@
 
     // required
-    PXOPT_LOOKUP_STR(workdir, config->args, "-workdir",  true, false);
 
     // optional
@@ -171,5 +171,5 @@
         psS64 stage = psMetadataLookupS64(NULL, row, "stage_id");   // Stage identifier
 
-        if (!publishRunInsert(config->dbh, 0, client, stage, workdir, set_label, "new")) {
+        if (!publishRunInsert(config->dbh, 0, client, stage, set_label, "new")) {
             psError(PS_ERR_UNKNOWN, false, "Unable to add fileset");
             psFree(output);
