Index: trunk/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- trunk/ippTools/share/pxadmin_create_tables.sql	(revision 35041)
+++ trunk/ippTools/share/pxadmin_create_tables.sql	(revision 35048)
@@ -2161,9 +2161,11 @@
     surveyID    INT(8),
     releaseName VARCHAR(64),
-    state       VARCHAR(16),    -- active, pending archive drop 
+    relase_state VARCHAR(16),   -- active, pending, archive, drop 
     dataRelease INT(8),         -- PSPS dataRelease
+    priority    INT(8),
     PRIMARY KEY(rel_id),
     KEY(releaseName),
     KEY(state),
+    KEY(priority),
     FOREIGN KEY(surveyID) REFERENCES survey(surveyID)
 ) ENGINE=Innodb DEFAULT CHARSET=latin1;
@@ -2191,5 +2193,29 @@
 ) ENGINE=innodb DEFAULT CHARSET=latin1;
 
-
--- This comment line is here to avoid empty query error.
+CREATE TABLE relStack (
+    relstack_id BIGINT AUTO_INCREMENT,
+    rel_id      INT(8),
+    skycal_id   BIGINT,         -- id of the sky calibration run that supplied the calibration
+                                -- for this release. We get back to stack from here
+    skycell_id  varchar(64),
+    tess_id     varchar(64),
+    state       VARCHAR(16),    -- released, pending, archive, drop  
+    flags       INT UNSIGNED,
+    stack_type  VARCHAR(16),    -- nightly, deep, reference
+    zpt_obs     FLOAT,          -- calibrated zero point for this release of this skycell
+    zpt_stdev   FLOAT,
+    fwhm_major  FLOAT,          -- seeing as measured by staticsky
+    path_base   VARCHAR(255),   -- path_base of any supporting files,
+    registered  DATETIME,
+    time_stamp  DATETIME,
+    PRIMARY KEY (relstack_id),
+    KEY (tess_id, skycell_id),
+    KEY (rel_id, tess_id, skycell_id),
+    FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id),
+    FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+
+
+-- These comment lines are here to avoid an empty query error.
 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy.
Index: trunk/ippTools/share/releasetool_listrelexp.sql
===================================================================
--- trunk/ippTools/share/releasetool_listrelexp.sql	(revision 35041)
+++ trunk/ippTools/share/releasetool_listrelexp.sql	(revision 35048)
@@ -1,9 +1,11 @@
 SELECT
     relexp_id,
-    releaseName,
     relExp.state,
-    rel_id,
+    ippRelease.releaseName,
+    ippRelease.release_state,
+    ippRelease.rel_id,
+    ippRelease.priority,
     survey.surveyName,
-    exp_name,
+    rawExp.exp_name,
     relExp.flags,
     relExp.zpt_obs,
@@ -12,12 +14,12 @@
     relExp.registered,
     relExp.time_stamp,
-    exp_id,
-    chip_id,
+    relExp.exp_id,
+    relExp.chip_id,
     chipRun.state as chip_state,
-    cam_id,
+    relExp.cam_id,
     camRun.state as cam_state,
     camProcessedExp.path_base as cam_path_base,
     camProcessedExp.fwhm_major,
-    warp_id,
+    warpRun.warp_id,
     warpRun.state as warp_state,
     rawExp.filter,
@@ -25,5 +27,4 @@
     TRUNCATE(DEGREES(rawExp.ra), 4) AS radeg,
     TRUNCATE(DEGREES(rawExp.decl), 4) AS decdeg,
-    rawExp.object,
     rawExp.comment
 FROM relExp 
