summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-08-04 18:24:15 +0200
committerDylan William Hardison <dylan@hardison.net>2018-08-04 18:24:15 +0200
commitf44392e8cdbea85ac308b2472f813ee605ebae4b (patch)
tree6e7adaf99a0e5a43eb1bf5a0d673d86b60f34f99 /Bugzilla/Install
parent5be3a7fd0061aa0bc3059e09079741873b9b833f (diff)
parent4528b21bc922f8b1e0ba8581d230a492aa43c9cf (diff)
downloadbugzilla-f44392e8cdbea85ac308b2472f813ee605ebae4b.tar.gz
bugzilla-f44392e8cdbea85ac308b2472f813ee605ebae4b.tar.xz
Merge branch 'mojo-poc'
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 86edf8a30..8b3d4b8cc 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 #
@@ -3920,6 +3921,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');