Index: trunk/dbconfig/chip.md
===================================================================
--- trunk/dbconfig/chip.md	(revision 13937)
+++ trunk/dbconfig/chip.md	(revision 14017)
@@ -1,10 +1,12 @@
-# do we need nclass?
-# class is missing
+#
+#  We are dependant on the assumption that there is only ever one exp_tag in a
+#  chipRun although the database does not enforce this.
+#
 
-chipPendingExp METADATA
+chipRun METADATA
     chip_id     S64         0       # Primary Key AUTO_INCREMENT
-    exp_tag     STR         64      # Primary Key
-    guide_id    S64         0       # Not NULL
+    state       STR         64      # key
     workdir     STR         255 
+    workdir_state STR       64      # key
     label       STR         64      # key
     reduction   STR         64      # Reduction class
@@ -13,39 +15,13 @@
 END
 
-# uris in & out ?
-
-chipPendingImfile METADATA
-    chip_id     S64         0       # Primary Key
+chipInputImfile METADATA
+    chip_id     S64         0       # Primary Key fkey (chip_id) ref chipRun(chip_id)
+    exp_tag     STR         64      # Primary Key fkey (exp_tag, class_id) ref rawImfile (exp_tag, class_id)
     class_id    STR         64      # Primary Key
-    uri         STR         255
 END
 
-# nclass & ndone?
-# and/or logging imfile done better?
-
-chipProcessedExp METADATA
-    chip_id     S64         0       # Primary Key
+chipProcessedImfile METADATA
+    chip_id     S64         0       # Primary Key fkey (chip_id, exp_tag, class_id) ref chipPendingImfile(chip_id, exp_tag, class_id)
     exp_tag     STR         64      # Primary Key
-    guide_id    S64         0       # Not NULL
-    workdir     STR         255 
-    label       STR         64      # key
-    reduction   STR         64
-    expgroup    STR         64      # key
-    dvodb       STR         255
-END
-
-chipMask METADATA
-    label       STR         64      # Primary Key
-END
-
-# uris in & out ?
-# state?
-
-chipProcessedImfile METADATA
-    chip_id     S64         0       # Primary Key
-# exp_tag/guide_id are redudant with the values stored in chipProcessedExp.
-# exp_tag can be removed at virtually any time (SQL queriers will need to be
-# fixed) but guide_id needs to wait until we know if this can be tracked at
-# just the exp level.
     class_id        STR     64      # Primary Key
     uri             STR     255
@@ -71,2 +47,6 @@
     fault           S16     0       # Key NOT NULL
 END
+
+chipMask METADATA
+    label       STR         64      # Primary Key
+END
