← Back to team overview

launchpad-reviewers team mailing list archive

Re: lp:~linaro-infrastructure/launchpad/workitems-schema-changes into lp:launchpad/db-devel

 

Review: Approve db

Mostly fine.

Do we need a 'name' column on SpecificationWorkItem? If we need to address them individually in the URL space for the web UI or restful API, we might prefer a name rather than expose the internal id.

Please rename the 'date' column on SpecificationWorkItemChange to 'date_created'. This is consistent, and will avoid headaches from using a keyword as a column name.

I don't really like the 'day' column name on SpecificationWorkItemStats, but I can't think of a better alternative at the moment.

We need some indexes:

-- Foreign key, selecting by specification and sorting by date_created.
CREATE INDEX specificationworkitem__specification__date_created__idx
    ON SpecificationWorkItem(specification, date_created);

-- Foreign key.
CREATE INDEX specificationworkitem__milestone__idx
    ON SpecificationWorkItem(milestone);

-- Foreign key, required for person merge.
CREATE INDEX specificationworkitem__assignee__idx
    ON SpecificationWorkItem(assignee) WHERE assignee IS NOT NULL;


-- Foreign key, selecting by work_item and ordering by date_created
CREATE INDEX specificationworkitemchange__work_item__date_created__idx
    ON SpecificationWorkItemChange(work_item, date_created);

-- Foreign key.
CREATE INDEX specificationworkitemchange__new_milestone__idx
    ON SpecificationWorkItemChange(new_milestone)
        WHERE new_milestone IS NOT NULL;

-- Foreign key, required for person merge.
CREATE INDEX specificationworkitemchange__new_assignee__idx
    ON SpecificationWorkItemChange(new_assignee) WHERE new_assignee IS NOT NULL;

-- Foreign key, and selection by date.
CREATE INDEX specificationworkitemstats_specification__day__idx
    ON SpecificationWorkItemStats(specification, day);

-- Foreign key, required for person merge.
CREATE INDEX specificationworkitemstats__assignee__idx
    ON SpecificationWorkItemStats(assignee) WHERE assignee IS NOT NULL;

-- Foreign key.
CREATE INDEX specificationworkitemstats__milestone__idx
    ON SpecificationWorkItemStats(milestone) WHERE milestone IS NOT NULL;
-- 
https://code.launchpad.net/~linaro-infrastructure/launchpad/workitems-schema-changes/+merge/91295
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~linaro-infrastructure/launchpad/workitems-schema-changes into lp:launchpad/db-devel.


Follow ups

References