Commit 23c63e06 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 387831: Deleting products does not clean up the component_cc table - Patch…

Bug 387831: Deleting products does not clean up the component_cc table - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent dc9f2bad
...@@ -408,9 +408,16 @@ if ($action eq 'delete') { ...@@ -408,9 +408,16 @@ if ($action eq 'delete') {
$dbh->bz_lock_tables('products WRITE', 'components WRITE', $dbh->bz_lock_tables('products WRITE', 'components WRITE',
'versions WRITE', 'milestones WRITE', 'versions WRITE', 'milestones WRITE',
'group_control_map WRITE', 'group_control_map WRITE', 'component_cc WRITE',
'flaginclusions WRITE', 'flagexclusions WRITE'); 'flaginclusions WRITE', 'flagexclusions WRITE');
my $comp_ids = $dbh->selectcol_arrayref('SELECT id FROM components
WHERE product_id = ?',
undef, $product->id);
$dbh->do('DELETE FROM component_cc WHERE component_id IN
(' . join(',', @$comp_ids) . ')') if scalar(@$comp_ids);
$dbh->do("DELETE FROM components WHERE product_id = ?", $dbh->do("DELETE FROM components WHERE product_id = ?",
undef, $product->id); undef, $product->id);
......
...@@ -453,7 +453,8 @@ CrossCheck("profiles", "userid", ...@@ -453,7 +453,8 @@ CrossCheck("profiles", "userid",
["tokens", "userid"], ["tokens", "userid"],
["user_group_map", "user_id"], ["user_group_map", "user_id"],
["components", "initialowner", "name"], ["components", "initialowner", "name"],
["components", "initialqacontact", "name"]); ["components", "initialqacontact", "name"],
["component_cc", "user_id"]);
CrossCheck("products", "id", CrossCheck("products", "id",
["bugs", "product_id", "bug_id"], ["bugs", "product_id", "bug_id"],
...@@ -464,6 +465,9 @@ CrossCheck("products", "id", ...@@ -464,6 +465,9 @@ CrossCheck("products", "id",
["flaginclusions", "product_id", "type_id"], ["flaginclusions", "product_id", "type_id"],
["flagexclusions", "product_id", "type_id"]); ["flagexclusions", "product_id", "type_id"]);
CrossCheck("components", "id",
["component_cc", "component_id"]);
# Check the former enum types -mkanat@bugzilla.org # Check the former enum types -mkanat@bugzilla.org
CrossCheck("bug_status", "value", CrossCheck("bug_status", "value",
["bugs", "bug_status", "bug_id"]); ["bugs", "bug_status", "bug_id"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment