Index: /branches/pap_mops/dbconfig/publish.md
===================================================================
--- /branches/pap_mops/dbconfig/publish.md	(revision 24373)
+++ /branches/pap_mops/dbconfig/publish.md	(revision 24373)
@@ -0,0 +1,22 @@
+# Tables for publishing data to a science client
+
+publishClient   METADATA 
+    client_id   S64         0       # Primary Key AUTO_INCREMENT
+    comment     STR         255
+    stage	STR	    64
+    format      STR	    64
+    destination STR	    255
+END
+
+publishRun	METADATA
+    pub_id      S64         0       # Primary Key AUTO_INCREMENT
+    client_id   S64         0
+    stage_id    S64         0
+    state       STR         64
+END
+
+publishFile	METADATA
+    pub_id      S64         0       # Primary Key
+    component	STR	    64	    # Primary Key
+    fault	S16	    0
+END
Index: /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql	(revision 24372)
+++ /branches/pap_mops/ippTools/share/pxadmin_create_tables.sql	(revision 24373)
@@ -1368,4 +1368,58 @@
 
 
+
+-- 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
+    comment VARCHAR(255),            -- for human memory
+    stage VARCHAR(64),               -- stage of interest (chip, camera, diff, etc.)
+    format VARCHAR(64),              -- format of data
+    destination VARCHAR(255),        -- where to send data
+    PRIMARY KEY(client_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+-- Publishing a set
+CREATE TABLE publishRun (
+    pub_id BIGINT AUTO_INCREMENT, -- unique identifier
+    client_id BIGINT,             -- link to publishClient
+    stage_id BIGINT,              -- link to various stage tables
+    PRIMARY KEY(pub_id),
+    KEY(client_id),
+    KEY(stage_id),
+    FOREIGN KEY(client_id) REFERENCES publishClient(client_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE publishFile (
+    pub_id BIGINT AUTO_INCREMENT, -- link to publishRun
+    component VARCHAR(64),        --
+
+
+
+publishClient   METADATA
+    client_id   S64         0       # Primary Key AUTO_INCREMENT
+    comment     STR         255
+    stage       STR         64
+    format      STR         64
+    destination STR         255
+END
+
+publishRun      METADATA
+    pub_id      S64         0       # Primary Key AUTO_INCREMENT
+    client_id   S64         0
+    stage_id    S64         0
+    state       STR         64
+END
+
+publishFile     METADATA
+    pub_id      S64         0       # Primary Key
+    component   STR         64      # Primary Key
+    fault       S16         0
+END
+
+
+
+
 -- This comment line is here to avoid empty query error.
 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy.
