Code review comment for lp://staging/~bryce/launchpad/lp-644794-db-foreign-keys

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

Fine in general.

We need an index. The old column is UNIQUE, so I suspect the new columns need to be UNIQUE too:

ALTER TABLE BugTrackerComponent ADD CONSTRAINT bugtrackercomponent__disto__spn__key
UNIQUE (distribution, source_package_name);

We also should add a constraint ensuring that if distribution is set, source_package_name is also set:

ALTER TABLE BugTrackerComponent ADD CONSTRAINT valid_target
CHECK (distribution IS NULL = source_package_name IS NULL);

You will need to adjust the comments in comments.sql before this can land.

patch-2208-19-0.sql

review: Approve (db)

« Back to merge proposal