Merge lp:~cjwatson/launchpad/db-git-more into lp:launchpad

Proposed by Colin Watson on 2015-03-11
Status: Superseded
Proposed branch: lp:~cjwatson/launchpad/db-git-more
Merge into: lp:launchpad
Diff against target: 153 lines (+77/-6)
5 files modified
database/sampledata/current-dev.sql (+10/-3)
database/sampledata/current.sql (+10/-3)
database/schema/patch-2209-61-2.sql (+38/-0)
database/schema/patch-2209-62-1.sql (+16/-0)
database/schema/security.cfg (+3/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-git-more
Reviewer Review Type Date Requested Status
Stuart Bishop db 2015-03-11 Pending
Launchpad code reviewers db 2015-03-11 Pending
Review via email: mp+252671@code.launchpad.net

This proposal has been superseded by a proposal from 2015-03-11.

Commit message

Add GitRepository.description, flesh out GitRef, and add GitJob.

Description of the change

Here are some more Git-related database changes, mostly for the ref scanner. I fleshed out GitRef with some information about the tip commit of the ref so that we can show that in repository-level summary views in the web UI, and added a GitJob table which is enough to make the ref scanner work.

Also, GitRepository.description seems like a sensible thing to have, and doesn't seem worth splitting into a separate patch given that none of these tables contain any data outside of development systems yet.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2015-01-27 17:22:08 +0000
+++ database/sampledata/current-dev.sql 2015-03-11 23:58:19 +0000
@@ -3857,6 +3857,16 @@
3857ALTER TABLE garbojobstate ENABLE TRIGGER ALL;3857ALTER TABLE garbojobstate ENABLE TRIGGER ALL;
38583858
38593859
3860ALTER TABLE gitjob DISABLE TRIGGER ALL;
3861
3862
3863
3864ALTER TABLE gitjob ENABLE TRIGGER ALL;
3865
3866
3867
3868
3869
3860ALTER TABLE gitref DISABLE TRIGGER ALL;3870ALTER TABLE gitref DISABLE TRIGGER ALL;
38613871
38623872
@@ -3870,9 +3880,6 @@
38703880
38713881
38723882
3873
3874
3875
3876ALTER TABLE hwvendorname DISABLE TRIGGER ALL;3883ALTER TABLE hwvendorname DISABLE TRIGGER ALL;
38773884
3878INSERT INTO hwvendorname (id, name) VALUES (1, 'MSI');3885INSERT INTO hwvendorname (id, name) VALUES (1, 'MSI');
38793886
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2015-01-27 17:22:08 +0000
+++ database/sampledata/current.sql 2015-03-11 23:58:19 +0000
@@ -3784,6 +3784,16 @@
3784ALTER TABLE garbojobstate ENABLE TRIGGER ALL;3784ALTER TABLE garbojobstate ENABLE TRIGGER ALL;
37853785
37863786
3787ALTER TABLE gitjob DISABLE TRIGGER ALL;
3788
3789
3790
3791ALTER TABLE gitjob ENABLE TRIGGER ALL;
3792
3793
3794
3795
3796
3787ALTER TABLE gitref DISABLE TRIGGER ALL;3797ALTER TABLE gitref DISABLE TRIGGER ALL;
37883798
37893799
@@ -3797,9 +3807,6 @@
37973807
37983808
37993809
3800
3801
3802
3803ALTER TABLE hwvendorname DISABLE TRIGGER ALL;3810ALTER TABLE hwvendorname DISABLE TRIGGER ALL;
38043811
3805INSERT INTO hwvendorname (id, name) VALUES (1, 'MSI');3812INSERT INTO hwvendorname (id, name) VALUES (1, 'MSI');
38063813
=== added file 'database/schema/patch-2209-61-2.sql'
--- database/schema/patch-2209-61-2.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-61-2.sql 2015-03-11 23:58:19 +0000
@@ -0,0 +1,38 @@
1-- Copyright 2015 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6ALTER TABLE GitRepository ADD COLUMN description text;
7
8COMMENT ON COLUMN GitRepository.description IS 'A short description of this repository.';
9
10ALTER TABLE GitRef ADD COLUMN object_type integer NOT NULL;
11ALTER TABLE GitRef ADD COLUMN author integer REFERENCES revisionauthor;
12ALTER TABLE GitRef ADD COLUMN author_date timestamp without time zone;
13ALTER TABLE GitRef ADD COLUMN committer integer REFERENCES revisionauthor;
14ALTER TABLE GitRef ADD COLUMN committer_date timestamp without time zone;
15ALTER TABLE GitRef ADD COLUMN commit_message text;
16
17COMMENT ON COLUMN GitRef.object_type IS 'The type of object pointed to by this reference.';
18COMMENT ON COLUMN GitRef.author IS 'The author of the commit pointed to by this reference.';
19COMMENT ON COLUMN GitRef.author_date IS 'The author date of the commit pointed to by this reference.';
20COMMENT ON COLUMN GitRef.committer IS 'The committer of the commit pointed to by this reference.';
21COMMENT ON COLUMN GitRef.committer_date IS 'The committer date of the commit pointed to by this reference.';
22COMMENT ON COLUMN GitRef.commit_message IS 'The commit message of the commit pointed to by this reference.';
23
24CREATE TABLE GitJob (
25 id serial PRIMARY KEY,
26 job integer NOT NULL REFERENCES job,
27 repository integer NOT NULL REFERENCES gitrepository,
28 job_type integer NOT NULL,
29 json_data text
30);
31
32COMMENT ON TABLE GitJob IS 'Contains references to jobs that are executed for a Git repository.';
33COMMENT ON COLUMN GitJob.job IS 'A reference to a Job row that has all the common job details.';
34COMMENT ON COLUMN GitJob.repository IS 'The repository that this job is for.';
35COMMENT ON COLUMN GitJob.job_type IS 'The type of job, such as a ref scan.';
36COMMENT ON COLUMN GitJob.json_data IS 'Data that is specific to a particular job type.';
37
38INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 61, 2);
039
=== added file 'database/schema/patch-2209-62-1.sql'
--- database/schema/patch-2209-62-1.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-62-1.sql 2015-03-11 23:58:19 +0000
@@ -0,0 +1,16 @@
1-- Copyright 2015 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6ALTER TABLE translationtemplateitem
7 ADD COLUMN msgid_singular integer REFERENCES pomsgid,
8 ADD COLUMN msgid_plural integer REFERENCES pomsgid;
9ALTER TABLE potemplate ADD COLUMN suggestive bool;
10ALTER TABLE potmsgset ADD COLUMN suggestive bool;
11ALTER TABLE translationmessage
12 ADD COLUMN msgid_singular integer REFERENCES pomsgid,
13 ADD COLUMN msgid_plural integer REFERENCES pomsgid,
14 ADD COLUMN suggestive bool;
15
16INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 62, 1);
017
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2015-02-10 00:45:38 +0000
+++ database/schema/security.cfg 2015-03-11 23:58:19 +0000
@@ -196,6 +196,7 @@
196public.featureflag = SELECT, INSERT, UPDATE, DELETE196public.featureflag = SELECT, INSERT, UPDATE, DELETE
197public.featureflagchangelogentry = SELECT, INSERT, UPDATE197public.featureflagchangelogentry = SELECT, INSERT, UPDATE
198public.flatpackagesetinclusion = SELECT, INSERT, UPDATE, DELETE198public.flatpackagesetinclusion = SELECT, INSERT, UPDATE, DELETE
199public.gitjob = SELECT, INSERT, UPDATE, DELETE
199public.gitref = SELECT, INSERT, UPDATE, DELETE200public.gitref = SELECT, INSERT, UPDATE, DELETE
200public.gitrepository = SELECT, INSERT, UPDATE, DELETE201public.gitrepository = SELECT, INSERT, UPDATE, DELETE
201public.hwdevice = SELECT202public.hwdevice = SELECT
@@ -687,6 +688,7 @@
687public.distributionsourcepackage = SELECT, UPDATE688public.distributionsourcepackage = SELECT, UPDATE
688public.distroseries = SELECT689public.distroseries = SELECT
689public.emailaddress = SELECT690public.emailaddress = SELECT
691public.gitjob = SELECT, INSERT, UPDATE, DELETE
690public.gitref = SELECT, INSERT, UPDATE, DELETE692public.gitref = SELECT, INSERT, UPDATE, DELETE
691public.gitrepository = SELECT, UPDATE693public.gitrepository = SELECT, UPDATE
692public.incrementaldiff = SELECT694public.incrementaldiff = SELECT
@@ -2278,6 +2280,7 @@
2278public.diff = SELECT, DELETE2280public.diff = SELECT, DELETE
2279public.emailaddress = SELECT, UPDATE, DELETE2281public.emailaddress = SELECT, UPDATE, DELETE
2280public.garbojobstate = SELECT, INSERT, UPDATE, DELETE2282public.garbojobstate = SELECT, INSERT, UPDATE, DELETE
2283public.gitjob = SELECT, DELETE
2281public.hwsubmission = SELECT, UPDATE2284public.hwsubmission = SELECT, UPDATE
2282public.job = SELECT, INSERT, DELETE2285public.job = SELECT, INSERT, DELETE
2283public.latestpersonsourcepackagereleasecache = SELECT, INSERT, UPDATE2286public.latestpersonsourcepackagereleasecache = SELECT, INSERT, UPDATE