Rework cross derivations support

Stop using the system values as targets, and remove package derivation entries
where this is the case.

Switch the non-cross derivation case to have a target of "", rather than
matching the system, as this makes more sense, and is more consistent now that
the target values no longer match the system values.

Hardcode some more correct target values, and use these instead. Hopefully
this can be better integrated with Guix in the future.

This commit also includes a migration attempting to shrink some indexes.
This commit is contained in:
Christopher Baines 2020-02-08 11:16:08 +00:00
parent 77beb59495
commit f1989e8758
19 changed files with 202 additions and 21 deletions

View file

@ -0,0 +1,30 @@
-- Deploy guix-data-service:remove_old_cross_derivations to pg
BEGIN;
DELETE FROM guix_revision_package_derivations WHERE package_derivation_id IN (
SELECT id
FROM package_derivations
WHERE target IN (
'aarch64-linux',
'armhf-linux',
'i686-linux',
'mips64el-linux',
'x86_64-linux'
)
);
-- Checking this constraint is expensive, so drop it, then re-create it
ALTER TABLE guix_revision_package_derivations DROP CONSTRAINT guix_revision_package_derivations_package_derivation_id_fkey;
DELETE FROM package_derivations WHERE target IN (
'aarch64-linux',
'armhf-linux',
'i686-linux',
'mips64el-linux',
'x86_64-linux'
);
ALTER TABLE guix_revision_package_derivations ADD CONSTRAINT "guix_revision_package_derivations_package_derivation_id_fkey" FOREIGN KEY (package_derivation_id) REFERENCES package_derivations(id);
COMMIT;