Ensure that stoptime and starttime are set for finished builds

[?]
May 23, 2013, 4:05 PM
TM6C352UKNHUHQQSKTQ2U7DRYA6HXPCFJ4QV57GZHA7DTT3G2ZQAC

Dependencies

  • [2] HPEG2RHV Merge the BuildResultInfo table into the Builds table
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] 37R34XJO * Negative caching: don't perform a build if a dependency already
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • edit in src/sql/hydra.sql at line 186
    [5.5211]
    [2.11270]
    check (finished = 0 or (stoptime is not null and stoptime != 0)),
    check (finished = 0 or (starttime is not null and starttime != 0)),
  • file addition: upgrade-15.sql (----------)
    [6.3004]
    -- Previously we didn't always set stoptime. For those builds, set
    -- stoptime to timestamp, since back then timestamp was the time the
    -- build finished (for finished builds).
    update builds set stoptime = timestamp where finished = 1 and (stoptime is null or stoptime = 0);
    -- Idem for starttime.
    update builds set starttime = timestamp where finished = 1 and (starttime is null or starttime = 0);
    alter table builds add check (finished = 0 or (stoptime is not null and stoptime != 0));
    alter table builds add check (finished = 0 or (starttime is not null and starttime != 0));