summaryrefslogtreecommitdiffstats
path: root/contrib/reorg-tools/syncmsandversions.pl
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-04-09 18:22:53 +0200
committerByron Jones <bjones@mozilla.com>2013-04-09 18:22:53 +0200
commit9e59b45c2a50c0b3f403242b89fa6083ce753303 (patch)
treeccbfe9873eb3d2d3105470ec5b463c04b9c9c164 /contrib/reorg-tools/syncmsandversions.pl
parent080208aa7bf1c182429c2367c6d6744c246ecacb (diff)
downloadbugzilla-9e59b45c2a50c0b3f403242b89fa6083ce753303.tar.gz
bugzilla-9e59b45c2a50c0b3f403242b89fa6083ce753303.tar.xz
Bug 859406: syncmsandversions.pl doesn't copy the isactive field
Diffstat (limited to 'contrib/reorg-tools/syncmsandversions.pl')
-rwxr-xr-xcontrib/reorg-tools/syncmsandversions.pl72
1 files changed, 43 insertions, 29 deletions
diff --git a/contrib/reorg-tools/syncmsandversions.pl b/contrib/reorg-tools/syncmsandversions.pl
index b25b3348b..1c3ce2154 100755
--- a/contrib/reorg-tools/syncmsandversions.pl
+++ b/contrib/reorg-tools/syncmsandversions.pl
@@ -73,35 +73,49 @@ if (!$tgtprodid) {
exit(1);
}
-#$dbh->bz_start_transaction();
-
-$dbh->do("INSERT INTO milestones(value, sortkey, product_id)
- SELECT m1.value, m1.sortkey, ? FROM milestones m1
- LEFT JOIN milestones m2 ON m1.value = m2.value AND
- m2.product_id = ?
- WHERE m1.product_id = ? AND m2.value IS NULL",
- undef,
- $tgtprodid, $tgtprodid, $srcprodid);
-
-$dbh->do("INSERT INTO versions(value, product_id)
- SELECT v1.value, ? FROM versions v1
- LEFT JOIN versions v2 ON v1.value = v2.value AND
- v2.product_id = ?
- WHERE v1.product_id = ? AND v2.value IS NULL",
- undef,
- $tgtprodid, $tgtprodid, $srcprodid);
-
-$dbh->do("INSERT INTO group_control_map (group_id, product_id, entry, membercontrol, othercontrol, canedit, editcomponents, editbugs, canconfirm)
- SELECT g1.group_id, ?, g1.entry, g1.membercontrol, g1.othercontrol, g1.canedit, g1.editcomponents, g1.editbugs, g1.canconfirm
- FROM group_control_map g1
- LEFT JOIN group_control_map g2 ON g1.product_id = ? AND
- g2.product_id = ? AND
- g1.group_id = g2.group_id
- WHERE g1.product_id = ? AND g2.group_id IS NULL",
- undef,
- $tgtprodid, $srcprodid, $tgtprodid, $srcprodid);
-
-#$dbh->bz_commit_transaction();
+$dbh->bz_start_transaction();
+
+$dbh->do("
+ INSERT INTO milestones(value, sortkey, isactive, product_id)
+ SELECT m1.value, m1.sortkey, m1.isactive, ?
+ FROM milestones m1
+ LEFT JOIN milestones m2 ON m1.value = m2.value
+ AND m2.product_id = ?
+ WHERE m1.product_id = ?
+ AND m2.value IS NULL
+ ",
+ undef,
+ $tgtprodid, $tgtprodid, $srcprodid);
+
+$dbh->do("
+ INSERT INTO versions(value, isactive, product_id)
+ SELECT v1.value, v1.isactive, ?
+ FROM versions v1
+ LEFT JOIN versions v2 ON v1.value = v2.value
+ AND v2.product_id = ?
+ WHERE v1.product_id = ?
+ AND v2.value IS NULL
+ ",
+ undef,
+ $tgtprodid, $tgtprodid, $srcprodid);
+
+$dbh->do("
+ INSERT INTO group_control_map (group_id, product_id, entry, membercontrol,
+ othercontrol, canedit, editcomponents,
+ editbugs, canconfirm)
+ SELECT g1.group_id, ?, g1.entry, g1.membercontrol, g1.othercontrol,
+ g1.canedit, g1.editcomponents, g1.editbugs, g1.canconfirm
+ FROM group_control_map g1
+ LEFT JOIN group_control_map g2 ON g1.product_id = ?
+ AND g2.product_id = ?
+ AND g1.group_id = g2.group_id
+ WHERE g1.product_id = ?
+ AND g2.group_id IS NULL
+ ",
+ undef,
+ $tgtprodid, $srcprodid, $tgtprodid, $srcprodid);
+
+$dbh->bz_commit_transaction();
exit(0);