aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-data-service-create-small-backup
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-03-13 18:38:29 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-13 18:38:29 +0000
commit6ce96ad55b1092014cfe1616f219aa2c7ce74ebb (patch)
tree3ec0f6044d7ac17236040da9cc3cc55b4f44a9e2 /scripts/guix-data-service-create-small-backup
parentb64e6b19c22488b11fa2bd70399aed302988343f (diff)
downloaddata-service-6ce96ad55b1092014cfe1616f219aa2c7ce74ebb.tar
data-service-6ce96ad55b1092014cfe1616f219aa2c7ce74ebb.tar.gz
Trip the derivation output details table in the small data dump
Diffstat (limited to 'scripts/guix-data-service-create-small-backup')
-rwxr-xr-xscripts/guix-data-service-create-small-backup10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/guix-data-service-create-small-backup b/scripts/guix-data-service-create-small-backup
index a5f8cc6..0d9f5b4 100755
--- a/scripts/guix-data-service-create-small-backup
+++ b/scripts/guix-data-service-create-small-backup
@@ -90,6 +90,11 @@ SELECT *
FROM derivation_outputs
WHERE derivation_id IN (SELECT id FROM tmp_derivations);
+CREATE UNLOGGED TABLE tmp_derivation_output_details AS
+SELECT *
+FROM derivation_output_details
+WHERE id IN (SELECT derivation_output_details_id FROM tmp_derivation_outputs);
+
CREATE UNLOGGED TABLE tmp_derivation_sources AS
SELECT *
FROM derivation_sources
@@ -97,6 +102,7 @@ WHERE derivation_id IN (SELECT id FROM tmp_derivations);
TRUNCATE package_derivations CASCADE;
TRUNCATE derivations CASCADE;
+TRUNCATE derivation_output_details, derivation_outputs, derivation_inputs;
EOF
@@ -215,6 +221,9 @@ INSERT INTO builds OVERRIDING SYSTEM VALUE
INSERT INTO build_status OVERRIDING SYSTEM VALUE
SELECT * FROM tmp_build_status;
+INSERT INTO derivation_output_details OVERRIDING SYSTEM VALUE
+ SELECT * FROM tmp_derivation_output_details;
+
INSERT INTO derivation_outputs OVERRIDING SYSTEM VALUE
SELECT * FROM tmp_derivation_outputs;
@@ -238,6 +247,7 @@ DROP TABLE tmp_package_derivations;
DROP TABLE tmp_guix_revision_package_derivations;
DROP TABLE tmp_builds;
DROP TABLE tmp_build_status;
+DROP TABLE tmp_derivation_output_details;
DROP TABLE tmp_derivation_outputs;
DROP TABLE tmp_derivation_inputs;
DROP TABLE tmp_derivation_sources;