Index: branches/eam_branches/ipp-20110404/dbconfig/add.md
===================================================================
--- branches/eam_branches/ipp-20110404/dbconfig/add.md	(revision 31166)
+++ branches/eam_branches/ipp-20110404/dbconfig/add.md	(revision 31439)
@@ -2,5 +2,6 @@
 addRun METADATA
     add_id          S64     0       # Primary Key AUTO_INCREMENT
-    cam_id          S64     0       # Key INDEX(add_id,cam_id) fkey(cam_id) ref camRun(cam_id)
+    stage 	    STR	    64      # what the stage is (warp, cam, diff,
+    stage_id          S64     0       # Key INDEX(add_id,cam_id) fkey(cam_id) ref camRun(cam_id)
     state           STR     64      # Key
     workdir         STR     255
Index: branches/eam_branches/ipp-20110404/dbconfig/changes.txt
===================================================================
--- branches/eam_branches/ipp-20110404/dbconfig/changes.txt	(revision 31166)
+++ branches/eam_branches/ipp-20110404/dbconfig/changes.txt	(revision 31439)
@@ -2057,5 +2057,77 @@
 
 UPDATE dbversion set schema_version = '1.1.69', updated= CURRENT_TIMESTAMP();
-
-
-
+ALTER TABLE addRun ADD COLUMN stage VARCHAR(64) AFTER add_id;
+ALTER TABLE addRun ADD COLUMN stage_id bigint(20) after stage;
+UPDATE addRun set stage_id = cam_id;
+
+-- these next steps I don't know if it's generic or not. This is how to drop
+   the cam_id table in addRun for gpc1
+
+show create table addRun;
+alter table `addRun` drop foreign key `addRun_ibfk_1`, drop column cam_id;
+
+-- this sets the addRun stage for all the old addRuns to 'cam' 
+
+
+--do this update only once, so I'm commenting it out (it's been done)
+-- update addRun set stage = 'cam';
+
+
+-- Version 1.1.70
+
+CREATE TABLE lapSequence (
+    seq_id BIGINT AUTO_INCREMENT, -- Identifier for the processing sequence
+    name VARCHAR(64) NOT NULL,    -- short name of the sequence
+    description VARCHAR(255) NOT NULL, -- longer description of the sequence
+    PRIMARY KEY(seq_id),
+    KEY(name)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE lapRun (
+    lap_id BIGINT AUTO_INCREMENT, -- Identifier for the processing run
+    seq_id BIGINT NOT NULL,       -- Identifier to match to the sequence
+    tess_id VARCHAR(64) NOT NULL, -- tessellation id to use
+    projection_cell VARCHAR(64) NOT NULL, -- projection cell from the tessellation to consider
+    filter VARCHAR(64) NOT NULL,  -- filter
+    state VARCHAR(64) NOT NULL,   -- state of run
+    label VARCHAR(64) NOT NULL,   -- processing label
+    dist_group VARCHAR(64) NOT NULL, -- distribution group for products of this run
+    registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered
+    fault SMALLINT NOT NULL,      -- fault code
+    quick_sass_id BIGINT,         -- stackAssociation id for quick stack
+    final_sass_id BIGINT,         -- stackAssociation id for final stack
+    PRIMARY KEY(lap_id),
+    KEY(seq_id),
+    KEY(projection_cell),
+    KEY(filter),
+    KEY(state),
+    KEY(label),
+    KEY(fault),
+    FOREIGN KEY(seq_id) REFERENCES lapSequence(seq_id),
+    FOREIGN KEY(quick_sass_id) REFERENCES stackAssociation(sass_id),
+    FOREIGN KEY(final_sass_id) REFERENCES stackAssociation(sass_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE lapExp (
+    lap_id BIGINT NOT NULL, -- Link back to processing run
+    exp_id BIGINT NOT NULL, -- exposure definition
+    chip_id BIGINT,         -- processing id from chipRun
+    pair_id BIGINT,         -- companion chip_id
+    private TINYINT DEFAULT 0, -- denotes this exposure is private
+    pairwise TINYINT DEFAULT 0, -- denotes if this exposure should be pairwise diffed
+    active TINYINT DEFAULT 0, -- denotes if this exposure is currently in use
+    data_state VARCHAR(64) NOT NULL, -- state of exposure
+    PRIMARY KEY (lap_id,exp_id),
+    KEY (lap_id),
+    KEY (exp_id),
+    KEY (chip_id),
+    KEY (pair_id),
+    KEY (data_state),
+    FOREIGN KEY (lap_id) REFERENCES lapRun(lap_id),
+    FOREIGN KEY (exp_id) REFERENCES rawExp(exp_id),
+    FOREIGN KEY (chip_id,exp_id) REFERENCES chipRun(chip_id,exp_id),
+    FOREIGN KEY (pair_id) REFERENCES chipRun(chip_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+UPDATE dbversion set schema_version = '1.1.70', updated= CURRENT_TIMESTAMP();
+
Index: branches/eam_branches/ipp-20110404/dbconfig/ipp.m4
===================================================================
--- branches/eam_branches/ipp-20110404/dbconfig/ipp.m4	(revision 31166)
+++ branches/eam_branches/ipp-20110404/dbconfig/ipp.m4	(revision 31439)
@@ -35,2 +35,3 @@
 include(background.md)
 include(diffphot.md)
+include(lap.md)
Index: branches/eam_branches/ipp-20110404/dbconfig/lap.md
===================================================================
--- branches/eam_branches/ipp-20110404/dbconfig/lap.md	(revision 31439)
+++ branches/eam_branches/ipp-20110404/dbconfig/lap.md	(revision 31439)
@@ -0,0 +1,31 @@
+lapSequence METADATA
+    seq_id         S64         0    # Primary Key AUTO_INCREMENT
+    name           STR         64   # Key
+    description    STR         255
+END
+
+lapRun METADATA
+    lap_id         S64         0    # Primary Key AUTO_INCREMENT
+    seq_id         S64         0    # Key fkey (seq_id) ref lapSequence(seq_id)
+    tess_id        STR         64
+    projection_cell STR        64   # Key
+    filter         STR         64   # Key
+    state          STR         64   # Key
+    label          STR         64   # Key
+    dist_group     STR         64 
+    registered     TAI	       NULL 
+    fault          S16	       0    # Key
+    quick_sass_id  S64         0    # fkey(quick_sass_id) ref stackAssociation(sass_id)
+    final_sass_id  S64         0    # fkey(final_sass_id) ref stackAssociation(sass_id)
+END
+
+lapExp METADATA
+    lap_id         S64         0    # Primary Key fkey (lap_id) ref lapRun(lap_id)
+    exp_id         S64         0    # Primary Key fkey (exp_id) ref rawExp(exp_id)
+    chip_id        S64         0    # Key fkey (exp_id, chip_id) ref chipRun(exp_id, chip_id)
+    pair_id        S64         0    # Key fkey (pair_id) ref chipRun(chip_id)
+    private        BOOL        f    
+    pairwise       BOOL        f    
+    active         BOOL        f
+    data_state     STR         64   # Key
+END
