Track package replacements

Start at least looking for package replacements, and storing the
details (particularly the derivation). I'm looking at doing this so that build
servers using the Guix Data Service can build these derivations.
This commit is contained in:
Christopher Baines 2021-07-11 10:44:59 +01:00
parent b4188bda9d
commit af209170f7
8 changed files with 118 additions and 18 deletions

View file

@ -0,0 +1,16 @@
-- Deploy guix-data-service:packages_replacement to pg
BEGIN;
ALTER TABLE packages
ADD COLUMN replacement_package_id integer REFERENCES packages (id);
ALTER TABLE packages DROP CONSTRAINT packages_pkey;
ALTER TABLE packages ADD PRIMARY KEY (id);
CREATE UNIQUE INDEX packages_not_null_replacement_package_id_idx
ON packages (name, version, package_metadata_id, replacement_package_id);
CREATE UNIQUE INDEX packages_null_replacement_package_id_idx
ON packages (name, version, package_metadata_id) WHERE replacement_package_id IS NULL;
COMMIT;