summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Migrate.pm
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-27 15:43:12 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-12-27 15:43:12 +0100
commitd67d9fd215186016ce370cd8fedc0ec891a081d1 (patch)
treee9b8d9319167caa00bd7cf47fc0f9ed12b259e93 /Bugzilla/Migrate.pm
parentbe04e7e48977def76cce03934854afb471ceed40 (diff)
downloadbugzilla-d67d9fd215186016ce370cd8fedc0ec891a081d1.tar.gz
bugzilla-d67d9fd215186016ce370cd8fedc0ec891a081d1.tar.xz
WIP: Migrate duplicate ID
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'Bugzilla/Migrate.pm')
-rw-r--r--Bugzilla/Migrate.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm
index 5058bc6f7..1aedbe39f 100644
--- a/Bugzilla/Migrate.pm
+++ b/Bugzilla/Migrate.pm
@@ -716,6 +716,7 @@ sub insert_bugs {
my $comments = delete $bug->{comments};
my $history = delete $bug->{history};
my $attachments = delete $bug->{attachments};
+ my $dup_id = delete $bug->{dup_id};
$self->debug($bug, 3);
@@ -776,6 +777,9 @@ sub insert_bugs {
$reporter->{groups} = $super_user->groups;
Bugzilla->set_user($reporter);
my $created = Bugzilla::Bug->create($bug);
+ if (defined $dup_id) {
+ $dbh->do("INSERT INTO duplicates (dupe_of, dupe) VALUES (?, ?)", undef, $dup_id, $created->id);
+ }
$self->debug('Created bug ' . $created->id);
Bugzilla->set_user($super_user);