Merge lp:~gmb/launchpad/blob-processing-job-table-bug-513762 into lp:launchpad/db-devel

Proposed by Graham Binns
Status: Merged
Approved by: Jonathan Lange
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~gmb/launchpad/blob-processing-job-table-bug-513762
Merge into: lp:launchpad/db-devel
Diff against target: 36 lines (+21/-0)
2 files modified
database/schema/comments.sql (+7/-0)
database/schema/patch-2207-30-0.sql (+14/-0)
To merge this branch: bzr merge lp:~gmb/launchpad/blob-processing-job-table-bug-513762
Reviewer Review Type Date Requested Status
Jonathan Lange (community) db Approve
Stuart Bishop (community) Approve
Review via email: mp+18218@code.launchpad.net

Commit message

Add an ApportJob table so that the Jobs system can be used to process Apport BLOBs.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

This branch adds an ApportJob table for storing data about Apport blob-processing jobs.

Revision history for this message
Jonathan Lange (jml) wrote :

Needs comments, probably needs indexes. Still not sure how I feel about the name.

In principle, I'm OK with it.

review: Needs Fixing (db)
Revision history for this message
Graham Binns (gmb) wrote :

Argh, comments added.

Jono, I know what you mean about the table name not being terribly good, but I can't think of a better one. Can you?

Revision history for this message
Stuart Bishop (stub) wrote :

Job should be unique I think, and an index is needed:

ALTER TABLE ApportJob ADD CONSTRAINT apportjob__job__key UNIQUE (job);

CREATE INDEX apportjob__blob__idx ON ApportJob(blob);

patch-2207-30-0.sql

review: Approve
Revision history for this message
Jonathan Lange (jml) wrote :

Looks great, thanks.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/comments.sql'
2--- database/schema/comments.sql 2010-02-02 18:21:45 +0000
3+++ database/schema/comments.sql 2010-02-03 15:57:15 +0000
4@@ -22,6 +22,13 @@
5 COMMENT ON COLUMN AnswerContact.person IS 'The person or team associated with the question target.';
6 COMMENT ON COLUMN AnswerContact.date_created IS 'The date the answer contact was submitted.';
7
8+-- ApportJob
9+
10+COMMENT ON TABLE ApportJob IS 'Contains references to jobs to be run against Apport BLOBs.';
11+COMMENT ON COLUMN ApportJob.blob IS 'The TemporaryBlobStorage entry on which the job is to be run.';
12+COMMENT ON COLUMN ApportJob.job_type IS 'The type of job (enumeration value). Allows us to query the database for a given subset of ApportJobs.';
13+COMMENT ON COLUMN ApportJob.json_data IS 'A JSON struct containing data for the job.';
14+
15 -- Branch
16 COMMENT ON TABLE Branch IS 'Bzr branch';
17 COMMENT ON COLUMN Branch.registrant IS 'The user that registered the branch.';
18
19=== added file 'database/schema/patch-2207-30-0.sql'
20--- database/schema/patch-2207-30-0.sql 1970-01-01 00:00:00 +0000
21+++ database/schema/patch-2207-30-0.sql 2010-02-03 15:57:15 +0000
22@@ -0,0 +1,14 @@
23+SET client_min_messages=ERROR;
24+
25+CREATE TABLE ApportJob(
26+ id serial NOT NULL PRIMARY KEY,
27+ job integer NOT NULL REFERENCES Job(id),
28+ blob integer NOT NULL REFERENCES TemporaryBlobStorage(id),
29+ job_type integer NOT NULL,
30+ json_data text
31+);
32+
33+ALTER TABLE ApportJob ADD CONSTRAINT apportjob__job__key UNIQUE (job);
34+CREATE INDEX apportjob__blob__idx ON ApportJob(blob);
35+
36+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 30, 0)

Subscribers

People subscribed via source and target branches

to status/vote changes: