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:42 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-13 18:38:42 +0000
commitbaeae56de4f7acae5c7e4fe475ba97b2695ad2f8 (patch)
treec428fec22a13914f8b93a4880574ea240c2c049c /scripts/guix-data-service-create-small-backup
parent6ce96ad55b1092014cfe1616f219aa2c7ce74ebb (diff)
downloaddata-service-baeae56de4f7acae5c7e4fe475ba97b2695ad2f8.tar
data-service-baeae56de4f7acae5c7e4fe475ba97b2695ad2f8.tar.gz
Don't use TRUNCATE CASCADE in the create small backup script
As it makes it clearer what tables will be truncated.
Diffstat (limited to 'scripts/guix-data-service-create-small-backup')
-rwxr-xr-xscripts/guix-data-service-create-small-backup18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/guix-data-service-create-small-backup b/scripts/guix-data-service-create-small-backup
index 0d9f5b4..bc6ed8c 100755
--- a/scripts/guix-data-service-create-small-backup
+++ b/scripts/guix-data-service-create-small-backup
@@ -100,9 +100,16 @@ SELECT *
FROM derivation_sources
WHERE derivation_id IN (SELECT id FROM tmp_derivations);
-TRUNCATE package_derivations CASCADE;
-TRUNCATE derivations CASCADE;
-TRUNCATE derivation_output_details, derivation_outputs, derivation_inputs;
+TRUNCATE derivations,
+ derivation_inputs,
+ derivation_outputs,
+ derivation_output_details,
+ derivation_sources,
+ derivations_by_output_details_set,
+ channel_instances,
+ guix_revision_system_test_derivations,
+ guix_revision_package_derivations,
+ package_derivations;
EOF
@@ -118,7 +125,7 @@ SELECT *
FROM build_status
WHERE build_id IN (SELECT id FROM tmp_builds);
-TRUNCATE builds CASCADE;
+TRUNCATE builds, build_status;
EOF
@@ -141,8 +148,7 @@ WHERE derivation_source_file_id IN (
SELECT id FROM tmp_derivation_source_files
);
-TRUNCATE derivation_source_files CASCADE; -- Cascades to derivation_sources
-TRUNCATE derivation_source_file_nars;
+TRUNCATE derivation_source_files, derivation_source_file_nars, derivation_sources;
EOF