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
);
e71'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/po/doc/guix-manual.fr.po'>
<input type='hidden' name='id' value='db80caa8ca46bf9f3d6c6981ee3a96a068881e71'/><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/tree/?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>root</a>/<a href='/guix/tree/po?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>po</a>/<a href='/guix/tree/po/doc?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>doc</a>/<a href='/guix/tree/po/doc/guix-manual.fr.po?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>guix-manual.fr.po</a></div><div class='content'>blob: 668c32f0e42a8ec92f10b4c36be525e5740a03d2 (<a href='/guix/about/po/doc/guix-manual.fr.po?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>about</a>) (<a href='/guix/plain/po/doc/guix-manual.fr.po?id=db80caa8ca46bf9f3d6c6981ee3a96a068881e71'>plain</a>)
<div class='error'>blob size (2403KB) exceeds display size limit (100KB).</div></div> <!-- class=content -->
                         <div class=footer>generated by
                             <a href="https://git.zx2c4.com/cgit/about/">
                                 cgit
                             </a>
                         </div>
                        </div> <!-- id=cgit -->
</body>
</html>
