From 424b21e37cd9aeac01588ce0defd3ee665944b1d Mon Sep 17 00:00:00 2001 From: Simon Green Date: Thu, 14 Aug 2014 09:40:47 +1000 Subject: Bug 1012506 - Allow a bug to have multiple aliases r=dkl, a=sgreen --- Bugzilla/Install/DB.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Bugzilla/Install') diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index dd0f3608b..b136e6d83 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -727,6 +727,9 @@ sub update_table_definitions { # 2014-07-27 LpSolit@gmail.com - Bug 1044561 _fix_user_api_keys_indexes(); + # 2014-08-11 sgreen@redhat.com - Bug 1012506 + _update_alias(); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -3899,6 +3902,19 @@ sub _fix_user_api_keys_indexes { } } +sub _update_alias { + my $dbh = Bugzilla->dbh; + return unless $dbh->bz_column_info('bugs', 'alias'); + + # We need to move the aliases from the bugs table to the bugs_aliases table + $dbh->do(q{ + INSERT INTO bugs_aliases (bug_id, alias) + SELECT bug_id, alias FROM bugs WHERE alias IS NOT NULL + }); + + $dbh->bz_drop_column('bugs', 'alias'); +} + 1; __END__ -- cgit v1.2.3-24-g4f1b