IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19622


Ignore:
Timestamp:
Sep 19, 2008, 4:05:33 PM (18 years ago)
Author:
bills
Message:

finish sql required to update detResidImfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/changes.txt

    r19620 r19622  
    472472
    473473ALTER TABLE detResidImfile add column ref_det_id bigint after iteration;
    474 ALTER TABLE detResidImfile add column ref_iter int after iteration;
    475 
    476 ALTER TABLE detResidImfile add column ref_det_id bigint after iteration;
    477 ALTER TABLE detResidImfile add column ref_iter int after iteration;
     474ALTER TABLE detResidImfile add column ref_iter int after ref_det_id;
    478475
    479476ALTER TABLE detRun change column parent ref_det_id bigint;
    480477ALTER TABLE detRun add column ref_iter int after ref_det_id;
    481478
    482 -- XXX need to change the foreign key constraints on detResidImfile:
    483 -- This
    484 --    FOREIGN KEY (det_id, iteration)
    485 --    REFERENCES  detNormalizedExp(det_id, iteration)
    486 -- Becomes:
    487 --    FOREIGN KEY (ref_det_id, ref_iter)
    488 --    REFERENCES  detNormalizedExp(det_id, iteration)
    489 
    490 -- XXX Need to population ref_det_id with the contents of det_id for detRun.mode == 'master'
     479-- populate ref_det_id and ref_iter
     480UPDATE detResidImfile SET ref_det_id = det_id, ref_iter = iteration;
     481
     482-- Next we drop the old constraint and add the new one
     483ALTER TABLE detResidImfile DROP FOREIGN KEY detResidImfile_ibfk_3;
     484ALTER TABLE detResidImfile add FOREIGN KEY (ref_det_id, ref_iter)
     485    REFERENCES  detNormalizedExp(det_id, iteration);
     486
     487
Note: See TracChangeset for help on using the changeset viewer.