Index: trunk/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- trunk/ippTools/share/pxadmin_create_tables.sql	(revision 19219)
+++ trunk/ippTools/share/pxadmin_create_tables.sql	(revision 19325)
@@ -976,5 +976,15 @@
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
 
-CREATE TABLE flatcorrExp (
+-- XXX deprecate this table
+-- CREATE TABLE flatcorrExp (
+--         corr_id BIGINT,
+--         chip_id BIGINT,
+--         PRIMARY KEY(corr_id, chip_id),
+--         FOREIGN KEY (corr_id)  REFERENCES  flatcorrRun(corr_id),
+--         FOREIGN KEY (chip_id)  REFERENCES  chipRun(chip_id)
+-- ) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+-- these two tables link the flatcorrRun to the associated chip and camera runs
+CREATE TABLE flatcorrChipLink (
         corr_id BIGINT,
         chip_id BIGINT,
@@ -982,4 +992,12 @@
         FOREIGN KEY (corr_id)  REFERENCES  flatcorrRun(corr_id),
         FOREIGN KEY (chip_id)  REFERENCES  chipRun(chip_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE flatcorrCamLink (
+        corr_id BIGINT,
+        cam_id BIGINT,
+        PRIMARY KEY(corr_id, cam_id),
+        FOREIGN KEY (corr_id)  REFERENCES  flatcorrRun(corr_id),
+        FOREIGN KEY (cam_id)  REFERENCES  camRun(cam_id)
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
 
