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;

View file

@ -0,0 +1,7 @@
-- Revert guix-data-service:packages_replacement from pg
BEGIN;
-- XXX Add DDLs here.
COMMIT;

View file

@ -81,3 +81,4 @@ remove_guix_revisions_store_path 2021-02-02T20:06:18Z Christopher Baines <mail@c
systems_table 2021-04-22T08:12:10Z Christopher Baines <mail@cbaines.net> # Add a systems table
some_indexes 2021-05-17T17:36:38Z Christopher Baines <mail@cbaines.net> # Add some indexes
package_metadata_location_id_index 2021-05-27T19:51:13Z Canan Talayhan <canan.t.talayhan@gmail.com> # Add index for location id
packages_replacement 2021-04-24T04:52:57Z Christopher Baines <mail@cbaines.net> # Add packages.replacement_package_id

View file

@ -0,0 +1,7 @@
-- Verify guix-data-service:packages_replacement on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;