Merge pull request #6324 from trofi/selfref-ca-index

ca: add sqlite index on `RealisationsRefs(realisationReference)`
This commit is contained in:
Théophane Hufschmitt
2022-04-21 10:06:39 +02:00
committed by Théophane Hufschmitt
6 changed files with 8 additions and 4 deletions
+2
View File
@@ -32,6 +32,8 @@ create table if not exists RealisationsRefs (
foreign key (referrer) references Realisations(id) on delete cascade,
foreign key (realisationReference) references Realisations(id) on delete restrict
);
-- used by deletion trigger
create index if not exists IndexRealisationsRefsRealisationReference on RealisationsRefs(realisationReference);
-- used by QueryRealisationReferences
create index if not exists IndexRealisationsRefs on RealisationsRefs(referrer);
+2
View File
@@ -152,6 +152,8 @@ void migrateCASchema(SQLite& db, Path schemaPath, AutoCloseFD& lockFd)
select id from Realisations where outputPath = old.id
);
end;
-- used by deletion trigger
create index if not exists IndexRealisationsRefsRealisationReference on RealisationsRefs(realisationReference);
)");
txn.commit();
}
@@ -2,7 +2,7 @@ source common.sh
file=build-hook-ca-floating.nix
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
CONTENT_ADDRESSED=true
+1 -1
View File
@@ -1,5 +1,5 @@
source ../common.sh
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
restartDaemon
+1 -1
View File
@@ -4,7 +4,7 @@ source common.sh
requireDaemonNewerThan "2.4pre20210626"
sed -i 's/experimental-features .*/& ca-derivations ca-references nix-command flakes/' "$NIX_CONF_DIR"/nix.conf
enableFeatures "ca-derivations nix-command flakes"
export NIX_TESTS_CA_BY_DEFAULT=1
cd ..
+1 -1
View File
@@ -3,7 +3,7 @@ source common.sh
clearStore
clearProfiles
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
restartDaemon
# Make a flake.