contrib/merge-users.pl should figure out columns to fix by tracing FKs

RESOLVED FIXED in Bugzilla 4.0

Status

()

Bugzilla
Bugzilla-General
--
enhancement
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

3.5.3
Bugzilla 4.0
Bug Flags:
approval +

Details

Attachments

(1 attachment)

v1
4.02 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
Instead of having a static list of columns, contrib/merge-users.pl should use the database's foreign keys (just figuring out which columns point to profiles.userid). We would just have to separate a "get_related_fks" out of "drop_related_fks" in Bugzilla::DB for this.

If anybody's wondering, the inspiration for this is that I had to remove "votes" from contrib/merge-users.pl, and I think it'd be silly to add a hook to merge-users.pl just for this, when it can all automatically be figured out from the database.
(Assignee)

Updated

8 years ago
Severity: normal → enhancement
Target Milestone: --- → Bugzilla 3.8
(Assignee)

Comment 1

8 years ago
Created attachment 427041 [details] [diff] [review]
v1

Okay, so here it is. The DB part I grant r+ to as module owner, but the merge-users part should probably be checked over (although I did test it briefly).
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #427041 - Flags: review?(LpSolit)

Comment 2

8 years ago
Comment on attachment 427041 [details] [diff] [review]
v1

Works fine. r=LpSolit
Attachment #427041 - Flags: review?(LpSolit) → review+

Updated

8 years ago
Flags: approval+
(Assignee)

Comment 3

8 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/DB.pm
modified contrib/merge-users.pl
Committed revision 7069.
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.