Index: trunk/dbconfig/changes.txt
===================================================================
--- trunk/dbconfig/changes.txt	(revision 28089)
+++ trunk/dbconfig/changes.txt	(revision 28090)
@@ -1541,51 +1541,5 @@
 ALTER TABLE distRun ADD COLUMN alternate TINYINT DEFAULT 0 AFTER no_magic;
 
--- Tables for static sky analysis
-
--- A static sky analysis set
-CREATE TABLE staticskyRun (
-      ss_id BIGINT AUTO_INCREMENT, -- unique identifier
-      state VARCHAR(64) NOT NULL,  -- state of run (new, full, etc.)
-      workdir VARCHAR(255) NOT NULL, -- working directory
-      label VARCHAR(64),             -- processing label
-      data_group VARCHAR(64),        -- group for data
-      dist_group VARCHAR(64),        -- group for distribution
-      reduction VARCHAR(64),         -- reduction class (for altering recipe)
-      note VARCHAR(255),             -- note
-      registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered
-      PRIMARY KEY(ss_id),
-      KEY(state),
-      KEY(label),
-      KEY(data_group),
-      KEY(dist_group)
-) ENGINE=innodb DEFAULT CHARSET=latin1;
-
--- Inputs for static sky analysis
-CREATE TABLE staticskyInput (
-      ss_id BIGINT,             -- static sky identifier
-      stack_id BIGINT,          -- stack identifier
-      PRIMARY KEY(ss_id,stack_id),
-      KEY(stack_id),
-      FOREIGN KEY(ss_id) REFERENCES staticskyRun(ss_id),
-      FOREIGN KEY(stack_id) REFERENCES stackSumSkyfile(stack_id)
-) ENGINE=innodb DEFAULT CHARSET=latin1;
-
--- Result of static sky analysis
-CREATE TABLE staticskyResult (
-      ss_id BIGINT,             -- static sky identifier
-      path_base VARCHAR(255) NOT NULL, -- root name for outputs
-      dtime_phot FLOAT,                -- elapsed time for photometry
-      dtime_script FLOAT,              -- elapsed time for script
-      sources INT,                     -- number of sources
-      hostname VARCHAR(64) NOT NULL,   -- host that executed script
-      good_frac FLOAT,                 -- good fraction of skycell
-      quality SMALLINT NOT NULL,       -- bad quality flag
-      fault SMALLINT NOT NULL,         -- fault code
-      PRIMARY KEY(ss_id),
-      KEY(good_frac),
-      KEY(fault),
-      KEY(quality),
-      FOREIGN KEY(ss_id) REFERENCES staticskyRun(ss_id)
-) ENGINE=innodb DEFAULT CHARSET=latin1;
+-- staticsky tables were re-configured and the entry moved below
 
 ALTER TABLE pstampDependent ADD COLUMN component VARCHAR(64) after stage_id;
@@ -1708,2 +1662,51 @@
 ALTER TABLE camProcessedExp ADD COLUMN maskfrac_max_magic FLOAT after maskfrac_max_dynamic;
 ALTER TABLE camProcessedExp ADD COLUMN maskfrac_max_advisory FLOAT after maskfrac_max_magic;
+
+-- these tables have not yet been used, and the definitions changed somewhat
+
+-- A static sky analysis set
+CREATE TABLE staticskyRun (
+      sky_id BIGINT AUTO_INCREMENT, -- unique identifier
+      state VARCHAR(64) NOT NULL,  -- state of run (new, full, etc.)
+      workdir VARCHAR(255) NOT NULL, -- working directory
+      label VARCHAR(64),             -- processing label
+      data_group VARCHAR(64),        -- group for data
+      dist_group VARCHAR(64),        -- group for distribution
+      reduction VARCHAR(64),         -- reduction class (for altering recipe)
+      note VARCHAR(255),             -- note
+      registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered
+      PRIMARY KEY(sky_id),
+      KEY(state),
+      KEY(label),
+      KEY(data_group),
+      KEY(dist_group)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+-- Inputs for static sky analysis
+CREATE TABLE staticskyInput (
+      sky_id BIGINT,             -- static sky identifier
+      stack_id BIGINT,          -- stack identifier
+      PRIMARY KEY(sky_id,stack_id),
+      KEY(stack_id),
+      FOREIGN KEY(sky_id) REFERENCES staticskyRun(sky_id),
+      FOREIGN KEY(stack_id) REFERENCES stackSumSkyfile(stack_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+-- Result of static sky analysis
+CREATE TABLE staticskyResult (
+      sky_id BIGINT,             -- static sky identifier
+      path_base VARCHAR(255) NOT NULL, -- root name for outputs
+      dtime_phot FLOAT,                -- elapsed time for photometry
+      dtime_script FLOAT,              -- elapsed time for script
+      sources INT,                     -- number of sources
+      hostname VARCHAR(64) NOT NULL,   -- host that executed script
+      good_frac FLOAT,                 -- good fraction of skycell
+      quality SMALLINT NOT NULL,       -- bad quality flag
+      fault SMALLINT NOT NULL,         -- fault code
+      PRIMARY KEY(sky_id),
+      KEY(good_frac),
+      KEY(fault),
+      KEY(quality),
+      FOREIGN KEY(sky_id) REFERENCES staticskyRun(sky_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
Index: trunk/dbconfig/ipp.m4
===================================================================
--- trunk/dbconfig/ipp.m4	(revision 28089)
+++ trunk/dbconfig/ipp.m4	(revision 28090)
@@ -20,4 +20,5 @@
 include(diff.md)
 include(stack.md)
+include(staticsky.md)
 include(det.md)
 include(label.md)
Index: trunk/dbconfig/staticsky.md
===================================================================
--- trunk/dbconfig/staticsky.md	(revision 28089)
+++ trunk/dbconfig/staticsky.md	(revision 28090)
@@ -1,3 +1,4 @@
 # Tables for static sky analysis
+# XXX add tess_id and skycell_id here?
 
 staticskyRun METADATA
@@ -20,4 +21,5 @@
 staticskyResult METADATA
     sky_id             S64    0       # Primary Key fkey(sky_id) ref staticskyRun(sky_id)
+    stack_id           S64    0       # Primary Key fkey(stack_id) ref stackSumSkyfile(stack_id)
     path_base          STR    255
     dtime_phot         F32    0.0
