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
);
='right' method='get' action='/guix/log/gnu/build/shepherd.scm'>
<input type='hidden' name='id' value='a5f4d3902708c87f6e4cf089f5f7334eb4cc07db'/><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=a5f4d3902708c87f6e4cf089f5f7334eb4cc07db'>root</a>/<a href='/guix/log/gnu?id=a5f4d3902708c87f6e4cf089f5f7334eb4cc07db'>gnu</a>/<a href='/guix/log/gnu/build?id=a5f4d3902708c87f6e4cf089f5f7334eb4cc07db'>build</a>/<a href='/guix/log/gnu/build/shepherd.scm?id=a5f4d3902708c87f6e4cf089f5f7334eb4cc07db'>shepherd.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/gnu/build/shepherd.scm?id=a5f4d3902708c87f6e4cf089f5f7334eb4cc07db&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th></tr>
<tr><td><span title='2020-11-05 16:13:50 +0100'>2020-11-05</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=e6934c0429ed94c9d9e61f81520d11153bbb3f64'>shepherd: Remove dependency on (guix utils).</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2020-09-21 10:22:12 +0200'>2020-09-21</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=6453915cf7729203ef9552c13cb4528c6f4ed122'>build: shepherd: Check for container support.</a><span class='msg-avail'>...</span></td><td>Mathieu Othacehe</td></tr>
<tr><td><span title='2020-09-02 17:05:23 +0200'>2020-09-02</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=8ce6f4dc2879919c12bc76a2f4b01200af97e019'>installer: Run the installation inside a container.</a><span class='msg-avail'>...</span></td><td>Mathieu Othacehe</td></tr>
<tr><td><span title='2020-06-12 00:04:42 +0200'>2020-06-12</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=8a02e45d93c2a825363da282791ac16f15b415e4'>shepherd: 'read-pid-file/container' terminates the whole process group.</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2020-06-12 00:04:42 +0200'>2020-06-12</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=b6b95685d0b478698d648f13afd927b1e1700d99'>shepherd: Unblock signals in the child process.</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2019-09-26 23:15:28 +0200'>2019-09-26</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=464caf72f9ff7600bd49e2df07e19cd9af28a930'>shepherd: Ensure the log file has correct ownership.</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2019-09-26 23:15:28 +0200'>2019-09-26</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=0d3a4fc867100651af8b27cdf66b1bca1c8ba663'>shepherd: 'make-forkexec-constructor/container' keeps the log file.</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
<tr><td><span title='2019-09-12 23:07:42 +0200'>2019-09-12</span></td><td><a href='/guix/commit/gnu/build/shepherd.scm?id=5ccec77176b7e0c67ed58c8849e5e76f3dd79a88'>file-systems: Add /var/run/nscd to '%network-file-mappings'.</a><span class='msg-avail'>...</span></td><td>Ludovic Courtès</td></tr>
