Store and display the location of packages

Store the location a package can be found at, and display this on the package
page.

If available, link off to the git repository containing the package.
This commit is contained in:
Christopher Baines 2019-05-13 21:02:53 +01:00
parent 9aaab6b751
commit 7341d17254
15 changed files with 217 additions and 28 deletions

View file

@ -0,0 +1,7 @@
-- Deploy guix-data-service:add_git_repositories_cgit_url_base to pg
BEGIN;
ALTER TABLE git_repositories ADD COLUMN cgit_url_base character varying;
COMMIT;

View file

@ -0,0 +1,20 @@
-- Deploy guix-data-service:add_location_information to pg
BEGIN;
CREATE TABLE locations (
id integer GENERATED BY DEFAULT AS IDENTITY,
file character varying NOT NULL,
line integer NOT NULL,
column_number integer NOT NULL,
CONSTRAINT file_line_column PRIMARY KEY(file, line, column_number),
UNIQUE (id)
);
ALTER TABLE package_metadata ADD COLUMN location_id integer REFERENCES locations(id);
ALTER TABLE package_metadata DROP CONSTRAINT synopsis_description_home_page;
ALTER TABLE package_metadata ADD CONSTRAINT synopsis_description_home_page_location_id UNIQUE (synopsis, description, home_page, location_id);
COMMIT;