From: Frédéric Buclin Date: Thu, 13 Aug 2015 22:09:28 +0000 (+0200) Subject: Bug 946780: The 'version' column of the 'bz_schema' DB table should be UNIQUE X-Git-Tag: release-5.1.1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac956759a67e7bff80b8a987cf7f6b646d1ee37f;p=thirdparty%2Fbugzilla.git Bug 946780: The 'version' column of the 'bz_schema' DB table should be UNIQUE r=dkl a=sgreen --- diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 5d5d52508d..d770f23588 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -1748,6 +1748,9 @@ use constant ABSTRACT_SCHEMA => { schema_data => {TYPE => 'LONGBLOB', NOTNULL => 1}, version => {TYPE => 'decimal(3,2)', NOTNULL => 1}, ], + INDEXES => [ + bz_schema_version_idx => {FIELDS => ['version'], TYPE => 'UNIQUE'}, + ], }, bug_user_last_visit => { diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index d317ee5947..bb82f5e2d0 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -741,6 +741,10 @@ sub update_table_definitions { $dbh->bz_alter_column('logincookies', 'cookie', {TYPE => 'varchar(22)', NOTNULL => 1, PRIMARYKEY => 1}); + # 2015-07-16 LpSolit@gmail.com - Bug 946780 + $dbh->bz_add_index('bz_schema', 'bz_schema_version_idx', + {FIELDS => ['version'], TYPE => 'UNIQUE'}); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################