create table if not exists ValidPaths (
    id               integer primary key autoincrement not null,
    path             text unique not null,
    hash             text not null,
    registrationTime integer not null,
    deriver          text,
    narSize          integer
);

create table if not exists Refs (
    referrer  integer not null,
    reference integer not null,
    primary key (referrer, reference),
    foreign key (referrer) references ValidPaths(id) on delete cascade,
    foreign key (reference) references ValidPaths(id) on delete restrict
);

create index if not exists IndexReferrer on Refs(referrer);
create index if not exists IndexReference on Refs(reference);

-- Paths can refer to themselves, causing a tuple (N, N) in the Refs
-- table.  This causes a deletion of the corresponding row in
-- ValidPaths to cause a foreign key constraint violation (due to `on
-- delete restrict' on the `reference' column).  Therefore, explicitly
-- get rid of self-references.
create trigger if not exists DeleteSelfRefs before delete on ValidPaths
  begin
    delete from Refs where referrer = old.id and reference = old.id;
  end;

create table if not exists DerivationOutputs (
    drv  integer not null,
    id   text not null, -- symbolic output id, usually "out"
    path text not null,
    primary key (drv, id),
    foreign key (drv) references ValidPaths(id) on delete cascade
);

create index if not exists IndexDerivationOutputs on DerivationOutputs(path);

create table if not exists FailedPaths (
    path text primary key not null,
    time integer not null
);
hod='get' action='/guix/log/etc/system-tests.scm'>
<input type='hidden' name='id' value='33bb89c939aee88bd211964db600df65d1b656af'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/guix/log/?id=33bb89c939aee88bd211964db600df65d1b656af'>root</a>/<a href='/guix/log/etc?id=33bb89c939aee88bd211964db600df65d1b656af'>etc</a>/<a href='/guix/log/etc/system-tests.scm?id=33bb89c939aee88bd211964db600df65d1b656af'>system-tests.scm</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/guix/log/etc/system-tests.scm?id=33bb89c939aee88bd211964db600df65d1b656af&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th></tr>
<tr><td><span title='2020-03-23 00:06:58 +0100'>2020-03-23</span></td><td><a href='/guix/commit/etc/system-tests.scm?id=8b18f5cb309f670b08ad35df6425f4e9e19d8a82'>tests: Use the same source as ci.guix.gnu.org.</a><span class='msg-avail'>...<span class='msg-tooltip'>* etc/system-tests.scm (system-test-manifest): In 'local-file' call, use
a name that is a function of COMMIT to match what Cuirass does.
</span></span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2020-03-05 16:33:38 +0100'>2020-03-05</span></td><td><a href='/guix/commit/etc/system-tests.scm?id=5ec4156bbcaec8337f78411204d59e59e706103b'>tests: Add a manifest for system tests.</a><span class='msg-avail'>...<span class='msg-tooltip'>The manifest can be passed to 'guix build -m', 'guix weather -m', and so
on.  It can also be passed to an installed 'guix' (without
./pre-inst-env), with the exception so far of installation tests.

* build-aux/run-system-tests.scm: Remove.  Move interesting bits move
to...
* etc/system-tests.scm: ... here.  New file.
* Makefile.am (EXTRA_DIST): Remove 'build-aux/run-system-tests.scm' and
add 'etc/system-tests.scm'.
(check-system): Rewrite to run 'guix build -m etc/system-tests.scm'.
</span></span></td><td>Ludovic Courtès</td></tr>
