summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-10-14 01:16:38 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2010-10-14 01:16:38 +0200
commit9ea6b6d34c9188172d3118314d33fed77d6dd63e (patch)
treefe330f644a7b7e5a76c1b668fd55470db99fa350 /Bugzilla
parentf0f0bc84ed98afaf3fc912911ca020d9e651ba11 (diff)
downloadbugzilla-9ea6b6d34c9188172d3118314d33fed77d6dd63e.tar.gz
bugzilla-9ea6b6d34c9188172d3118314d33fed77d6dd63e.tar.xz
Bug 451735: Wrong index for the series table
r/a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Schema.pm6
-rw-r--r--Bugzilla/Install/DB.pm13
2 files changed, 16 insertions, 3 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index c8adde17f..a64aa04a2 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -1304,9 +1304,9 @@ use constant ABSTRACT_SCHEMA => {
DEFAULT => 'FALSE'},
],
INDEXES => [
- series_creator_idx =>
- {FIELDS => [qw(creator category subcategory name)],
- TYPE => 'UNIQUE'},
+ series_creator_idx => ['creator'],
+ series_category_idx => {FIELDS => [qw(category subcategory name)],
+ TYPE => 'UNIQUE'},
],
},
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index b6e58b857..f8a9c15d3 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -637,6 +637,9 @@ sub update_table_definitions {
# 2010-10-09 LpSolit@gmail.com - Bug 505165
$dbh->bz_alter_column('flags', 'setter_id', {TYPE => 'INT3', NOTNULL => 1});
+ # 2010-10-09 LpSolit@gmail.com - Bug 451735
+ _fix_series_indexes();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3450,6 +3453,16 @@ sub _migrate_field_visibility_value {
}
}
+sub _fix_series_indexes {
+ my $dbh = Bugzilla->dbh;
+ return if $dbh->bz_index_info('series', 'series_category_idx');
+
+ $dbh->bz_drop_index('series', 'series_creator_idx');
+ $dbh->bz_add_index('series', 'series_creator_idx', ['creator']);
+ $dbh->bz_add_index('series', 'series_category_idx',
+ {FIELDS => [qw(category subcategory name)], TYPE => 'UNIQUE'});
+}
+
1;
__END__