Commit 9ea6b6d3 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 451735: Wrong index for the series table

r/a=mkanat
parent f0f0bc84
...@@ -1304,8 +1304,8 @@ use constant ABSTRACT_SCHEMA => { ...@@ -1304,8 +1304,8 @@ use constant ABSTRACT_SCHEMA => {
DEFAULT => 'FALSE'}, DEFAULT => 'FALSE'},
], ],
INDEXES => [ INDEXES => [
series_creator_idx => series_creator_idx => ['creator'],
{FIELDS => [qw(creator category subcategory name)], series_category_idx => {FIELDS => [qw(category subcategory name)],
TYPE => 'UNIQUE'}, TYPE => 'UNIQUE'},
], ],
}, },
......
...@@ -637,6 +637,9 @@ sub update_table_definitions { ...@@ -637,6 +637,9 @@ sub update_table_definitions {
# 2010-10-09 LpSolit@gmail.com - Bug 505165 # 2010-10-09 LpSolit@gmail.com - Bug 505165
$dbh->bz_alter_column('flags', 'setter_id', {TYPE => 'INT3', NOTNULL => 1}); $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 # # New --TABLE-- changes should go *** A B O V E *** this point #
################################################################ ################################################################
...@@ -3450,6 +3453,16 @@ sub _migrate_field_visibility_value { ...@@ -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; 1;
__END__ __END__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment