aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2022-03-26 18:03:49 +0100
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2022-04-21 10:06:39 +0200
commit0155a3b3da32a26becb259c546b98c93f7e414f2 (patch)
tree688b149bca6165447f566a45c889f81a2ac2e1b7
parent86d7a11c6b338a73c30476be13a6cac562e309c3 (diff)
parent975b0b52e74168b034ccff23827eff4d626f1c46 (diff)
Merge pull request #6324 from trofi/selfref-ca-index
ca: add sqlite index on `RealisationsRefs(realisationReference)`
-rw-r--r--src/libstore/ca-specific-schema.sql2
-rw-r--r--src/libstore/local-store.cc2
-rw-r--r--tests/build-remote-content-addressed-floating.sh2
-rw-r--r--tests/ca/common.sh2
-rwxr-xr-xtests/ca/selfref-gc.sh2
-rw-r--r--tests/nix-profile.sh2
6 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/ca-specific-schema.sql b/src/libstore/ca-specific-schema.sql
index c01dc5a76..4ca91f585 100644
--- a/src/libstore/ca-specific-schema.sql
+++ b/src/libstore/ca-specific-schema.sql
@@ -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);
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 76524b01c..5cc5c91cc 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -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();
}
diff --git a/tests/build-remote-content-addressed-floating.sh b/tests/build-remote-content-addressed-floating.sh
index 1f474dde0..e83b42b41 100644
--- a/tests/build-remote-content-addressed-floating.sh
+++ b/tests/build-remote-content-addressed-floating.sh
@@ -2,7 +2,7 @@ source common.sh
file=build-hook-ca-floating.nix
-enableFeatures "ca-derivations ca-references"
+enableFeatures "ca-derivations"
CONTENT_ADDRESSED=true
diff --git a/tests/ca/common.sh b/tests/ca/common.sh
index b9d415863..b104b5a78 100644
--- a/tests/ca/common.sh
+++ b/tests/ca/common.sh
@@ -1,5 +1,5 @@
source ../common.sh
-enableFeatures "ca-derivations ca-references"
+enableFeatures "ca-derivations"
restartDaemon
diff --git a/tests/ca/selfref-gc.sh b/tests/ca/selfref-gc.sh
index 89657f6de..248778894 100755
--- a/tests/ca/selfref-gc.sh
+++ b/tests/ca/selfref-gc.sh
@@ -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 ..
diff --git a/tests/nix-profile.sh b/tests/nix-profile.sh
index a7a4d4fa2..fad62b993 100644
--- a/tests/nix-profile.sh
+++ b/tests/nix-profile.sh
@@ -3,7 +3,7 @@ source common.sh
clearStore
clearProfiles
-enableFeatures "ca-derivations ca-references"
+enableFeatures "ca-derivations"
restartDaemon
# Make a flake.