From dd94f59acfa4512247f47ae9a1a01077cabaeb6d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 26 Dec 2019 08:53:51 +0000 Subject: Fix the representation of the fixed output derivation hashes Previously, they were nix-base32-string encoded, but the representation in the derivations is base16, so it doesn't make sense to use a different representation in the database. Therefore, add some code that runs before the start of each job to convert the data in the database. It was easier to do this in Guile with the existing support for working with these bytevector representations. After some migration period, the code for converting the old hashes can be removed. --- guix-data-service/jobs/load-new-guix-revision.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'guix-data-service/jobs') diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 1c58f21..753bfbd 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -1236,6 +1236,11 @@ SKIP LOCKED") (with-postgresql-connection (simple-format #f "load-new-guix-revision ~A" id) (lambda (conn) + ;; Fix the hash encoding of derivation_output_details. This'll only run + ;; once on any given database, but is kept here just to make sure any + ;; instances have the data updated. + (fix-derivation-output-details-hash-encoding conn) + (exec-query conn "BEGIN") (match (select-job-for-update conn id) -- cgit v1.2.3