summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-08-30 10:35:41 +0200
committerSimon Green <sgreen@redhat.com>2013-08-30 10:35:41 +0200
commit27bb05807772ff578f6b953fa4d1ec3164a2d34b (patch)
tree0827d7173969d00f7128c29ae2f5d89282b97fd8 /Bugzilla/Install
parent7450b47683d0aa972a522f5b70353e14269a95e6 (diff)
downloadbugzilla-27bb05807772ff578f6b953fa4d1ec3164a2d34b.tar.gz
bugzilla-27bb05807772ff578f6b953fa4d1ec3164a2d34b.tar.xz
Bug 903895 - Allow more than 32k components
r=gerv, a=sgreen
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm24
1 files changed, 22 insertions, 2 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index a45c5a5ea..a463fe879 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -711,6 +711,9 @@ sub update_table_definitions {
# 2013-02-04 dkl@mozilla.com - Bug 824346
_fix_flagclusions_indexes();
+ # 2013-08-26 sgreen@redhat.com - Bug 903895
+ _fix_components_primary_key();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -1429,9 +1432,9 @@ sub _use_ids_for_products_and_components {
print "Updating the database to use component IDs.\n";
$dbh->bz_add_column("components", "id",
- {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
$dbh->bz_add_column("bugs", "component_id",
- {TYPE => 'INT2', NOTNULL => 1}, 0);
+ {TYPE => 'INT3', NOTNULL => 1}, 0);
my %components;
$sth = $dbh->prepare("SELECT id, value, product_id FROM components");
@@ -3852,6 +3855,23 @@ sub _fix_flagclusions_indexes {
}
}
+sub _fix_components_primary_key {
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info('components', 'id')->{TYPE} ne 'MEDIUMSERIAL') {
+ $dbh->bz_drop_related_fks('components', 'id');
+ $dbh->bz_alter_column("components", "id",
+ {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ $dbh->bz_alter_column("flaginclusions", "component_id",
+ {TYPE => 'INT3'});
+ $dbh->bz_alter_column("flagexclusions", "component_id",
+ {TYPE => 'INT3'});
+ $dbh->bz_alter_column("bugs", "component_id",
+ {TYPE => 'INT3', NOTNULL => 1});
+ $dbh->bz_alter_column("component_cc", "component_id",
+ {TYPE => 'INT3', NOTNULL => 1});
+ }
+}
+
1;
__END__