aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-data-service-create-small-backup
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-03-25 18:26:33 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-25 18:26:33 +0000
commitb99854924aec961a57b518c1d4d2f0340fe77fb5 (patch)
tree4d7dd4f6e4608f650e7d5d233333e536da898f22 /scripts/guix-data-service-create-small-backup
parent60df7ecbf92ea57e3cf3b694459944a5d5fa682f (diff)
downloaddata-service-b99854924aec961a57b518c1d4d2f0340fe77fb5.tar
data-service-b99854924aec961a57b518c1d4d2f0340fe77fb5.tar.gz
Handle system test derivations in create-small-backup
Otherwise this table is empty.
Diffstat (limited to 'scripts/guix-data-service-create-small-backup')
-rwxr-xr-xscripts/guix-data-service-create-small-backup21
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/guix-data-service-create-small-backup b/scripts/guix-data-service-create-small-backup
index e5f5774..996b494 100755
--- a/scripts/guix-data-service-create-small-backup
+++ b/scripts/guix-data-service-create-small-backup
@@ -62,6 +62,17 @@ WHERE revision_id IN (
)
);
+CREATE UNLOGGED TABLE tmp_guix_revision_system_test_derivations AS
+SELECT *
+FROM guix_revision_system_test_derivations
+WHERE guix_revision_id IN (
+ SELECT id
+ FROM guix_revisions
+ WHERE commit IN (
+ SELECT commit FROM git_branches
+ )
+);
+
CREATE UNLOGGED TABLE tmp_package_derivations AS
SELECT * FROM package_derivations WHERE id IN (
SELECT package_derivation_id FROM tmp_guix_revision_package_derivations
@@ -69,7 +80,12 @@ SELECT * FROM package_derivations WHERE id IN (
CREATE UNLOGGED TABLE tmp_derivations AS
WITH RECURSIVE derivation_ids(id) AS (
- SELECT derivation_id FROM tmp_package_derivations
+ (
+ SELECT tmp_package_derivations.derivation_id FROM tmp_package_derivations
+ UNION
+ SELECT tmp_guix_revision_system_test_derivations.derivation_id
+ FROM tmp_guix_revision_system_test_derivations
+ )
UNION
SELECT derivation_outputs.derivation_id
FROM derivation_ids
@@ -209,6 +225,9 @@ INSERT INTO package_derivations OVERRIDING SYSTEM VALUE
INSERT INTO guix_revision_package_derivations
SELECT * FROM tmp_guix_revision_package_derivations;
+INSERT INTO guix_revision_system_test_derivations
+ SELECT * FROM tmp_guix_revision_system_test_derivations;
+
INSERT INTO builds OVERRIDING SYSTEM VALUE
SELECT * FROM tmp_builds;