aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-data-service-create-small-backup
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-03-25 18:27:01 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-25 18:27:01 +0000
commit8af7130239877bc8c24dd0c44ccd52d15d1eb1d0 (patch)
tree935372038ac6727be3dada7a800d8485ce811990 /scripts/guix-data-service-create-small-backup
parentb99854924aec961a57b518c1d4d2f0340fe77fb5 (diff)
downloaddata-service-8af7130239877bc8c24dd0c44ccd52d15d1eb1d0.tar
data-service-8af7130239877bc8c24dd0c44ccd52d15d1eb1d0.tar.gz
Handle channel instances 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-backup16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/guix-data-service-create-small-backup b/scripts/guix-data-service-create-small-backup
index 996b494..57ee5ef 100755
--- a/scripts/guix-data-service-create-small-backup
+++ b/scripts/guix-data-service-create-small-backup
@@ -73,6 +73,17 @@ WHERE guix_revision_id IN (
)
);
+CREATE UNLOGGED TABLE tmp_channel_instances AS
+SELECT *
+FROM channel_instances
+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
@@ -85,6 +96,8 @@ WITH RECURSIVE derivation_ids(id) AS (
UNION
SELECT tmp_guix_revision_system_test_derivations.derivation_id
FROM tmp_guix_revision_system_test_derivations
+ UNION
+ SELECT tmp_channel_instances.derivation_id FROM tmp_channel_instances
)
UNION
SELECT derivation_outputs.derivation_id
@@ -228,6 +241,9 @@ INSERT INTO guix_revision_package_derivations
INSERT INTO guix_revision_system_test_derivations
SELECT * FROM tmp_guix_revision_system_test_derivations;
+INSERT INTO channel_instances
+ SELECT * FROM tmp_channel_instances;
+
INSERT INTO builds OVERRIDING SYSTEM VALUE
SELECT * FROM tmp_builds;