Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! hnix-store-db: init
Browse files Browse the repository at this point in the history
  • Loading branch information
sorki committed Nov 16, 2023
1 parent 4b4578a commit d77a9c5
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions hnix-store-db/src/System/Nix/Store/DB/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,4 @@ share [ mkPersist sqlSettings
deriving Eq Show Ord
|]

{--
CREATE TABLE 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,
ultimate integer, -- null implies "false"
sigs text, -- space-separated
ca text -- if not null, an assertion that the path is content-addressed; see ValidPathInfo
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE 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 IndexReferrer on Refs(referrer);
CREATE INDEX IndexReference on Refs(reference);
CREATE TRIGGER DeleteSelfRefs before delete on ValidPaths
begin
delete from Refs where referrer = old.id and reference = old.id;
end;
CREATE TABLE 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 IndexDerivationOutputs on DerivationOutputs(path);
--}

0 comments on commit d77a9c5

Please sign in to comment.