Index: trunk/dbconfig/changes.txt
===================================================================
--- trunk/dbconfig/changes.txt	(revision 35156)
+++ trunk/dbconfig/changes.txt	(revision 35196)
@@ -2307,4 +2307,5 @@
     path_base   VARCHAR(255),   -- path_base of any supporting files for this
                                 -- release of this exposure.
+    fault SMALLINT NOT NULL,
     registered  DATETIME,       -- insertion time for this row
     time_stamp  DATETIME,       -- time of last update for this row
@@ -2312,4 +2313,5 @@
     FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id),
     KEY (state),
+    KEY (fault),
     FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id),
     FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id),
@@ -2323,6 +2325,7 @@
     skycal_id   BIGINT,         -- id of the sky calibration run that supplied the calibration
                                 -- for this release of this skycell.
-    skycell_id  varchar(64),
-    tess_id     varchar(64),
+    skycell_id  VARCHAR(64),
+    tess_id     VARCHAR(64),
+    filter      VARCHAR(16),
     state       VARCHAR(16),    -- released, pending, archive, drop  
     flags       INT UNSIGNED,
@@ -2330,11 +2333,16 @@
     zpt_obs     FLOAT,          -- calibrated zero point for this release of this skycell
     zpt_stdev   FLOAT,
-    fwhm_major  FLOAT,          -- seeing as measured by staticsky
+    mjd_obs     INT UNSIGNED,   -- for nightly stacks the mjd_obs
     path_base   VARCHAR(255),   -- path_base of any supporting files,
+    fault SMALLINT NOT NULL,
     registered  DATETIME,
     time_stamp  DATETIME,
     PRIMARY KEY (relstack_id),
     KEY (tess_id, skycell_id),
-    KEY (rel_id, tess_id, skycell_id),
+    KEY (rel_id, tess_id, skycell_id, filter, mjd_obs),
+    KEY (stack_type),
+    KEY (mjd_obs),
+    KEY (state),
+    KEY (fault),
     FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id),
     FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id)
@@ -2344,3 +2352,6 @@
 ALTER TABLE chipBackgroundRun ADD COLUMN cam_id BIGINT DEFAULT 0 AFTER chip_id;
 
+ALTER TABLE skycalResult ADD COLUMN fwhm_major FLOAT AFTER zpt_stdev;
+ALTER TABLE skycalResult ADD COLUMN fwhm_minor FLOAT AFTER fwhm_major;
+
 UPDATE dbversion set schema_version = '1.1.75', updated= CURRENT_TIMESTAMP();
