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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: no longer in the source branch.
Merged at revision: 12953
Proposed branch: lp:~cjwatson/launchpad/db-git-more
Merge into: lp:launchpad/db-devel
Diff against target: 131 lines (+60/-6)
4 files modified
database/sampledata/current-dev.sql (+10/-3)
database/sampledata/current.sql (+10/-3)
database/schema/patch-2209-61-2.sql (+37/-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
William Grant db Approve
Launchpad code reviewers db Pending
Stuart Bishop db Pending
Review via email: mp+252672@code.launchpad.net

This proposal supersedes 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.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
William Grant (wgrant) :
review: Approve (db)

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-12 11:41:01 +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-12 11:41:01 +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-12 11:41:01 +0000
@@ -0,0 +1,37 @@
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 job integer PRIMARY KEY REFERENCES job ON DELETE CASCADE UNIQUE NOT NULL,
26 repository integer NOT NULL REFERENCES gitrepository,
27 job_type integer NOT NULL,
28 json_data text
29);
30
31COMMENT ON TABLE GitJob IS 'Contains references to jobs that are executed for a Git repository.';
32COMMENT ON COLUMN GitJob.job IS 'A reference to a Job row that has all the common job details.';
33COMMENT ON COLUMN GitJob.repository IS 'The repository that this job is for.';
34COMMENT ON COLUMN GitJob.job_type IS 'The type of job, such as a ref scan.';
35COMMENT ON COLUMN GitJob.json_data IS 'Data that is specific to a particular job type.';
36
37INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 61, 2);
038
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2015-02-10 00:45:38 +0000
+++ database/schema/security.cfg 2015-03-12 11:41:01 +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

Subscribers

People subscribed via source and target branches

to status/vote changes: