summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-07-10 21:17:08 +0200
committerGitHub <noreply@github.com>2018-07-10 21:17:08 +0200
commit8de2aaf9e213651afaf12ec10b1091c22b7a9c55 (patch)
tree37120f452afdaadbb44c5a81de9d0958325da023 /Bugzilla/Install
parent446a08b30b0dbaac9f2b88e0a5cad410f0446140 (diff)
downloadbugzilla-8de2aaf9e213651afaf12ec10b1091c22b7a9c55.tar.gz
bugzilla-8de2aaf9e213651afaf12ec10b1091c22b7a9c55.tar.xz
Bug 1469911 - Make user autocompletion faster
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index d81bcfbdc..2e5ae5ff2 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -773,6 +773,7 @@ sub update_table_definitions {
$dbh->bz_add_index('profiles', 'profiles_realname_ft_idx',
{TYPE => 'FULLTEXT', FIELDS => ['realname']});
+ _migrate_nicknames();
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
@@ -3911,6 +3912,17 @@ sub _migrate_group_owners {
$dbh->do('UPDATE groups SET owner_user_id = ?', undef, $nobody->id);
}
+sub _migrate_nicknames {
+ my $dbh = Bugzilla->dbh;
+ my $sth = $dbh->prepare('SELECT userid FROM profiles WHERE realname LIKE "%:%" AND is_enabled = 1 AND NOT nickname');
+ $sth->execute();
+ while (my ($user_id) = $sth->fetchrow_array) {
+ my $user = Bugzilla::User->new($user_id);
+ $user->set_name($user->name);
+ $user->update();
+ }
+}
+
sub _migrate_preference_categories {
my $dbh = Bugzilla->dbh;
return if $dbh->bz_column_info('setting', 'category');