summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-07-31 17:31:06 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-07-31 17:31:06 +0200
commitd0b2bc684850c7a6287eaabd27a98469d868d4fa (patch)
tree0171ab5b5d23c03d230de83144ee922dcbb99de3 /Bugzilla/Install
parentcba46b0dd9b70c4483584f99d6d0722073632dc2 (diff)
downloadbugzilla-d0b2bc684850c7a6287eaabd27a98469d868d4fa.tar.gz
bugzilla-d0b2bc684850c7a6287eaabd27a98469d868d4fa.tar.xz
Bug 776982 - Increase longdescs primary key size to INTSERIAL for future growth
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index 382a50e50..31c8da71c 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -440,7 +440,7 @@ sub update_table_definitions {
# 2005-12-07 altlst@sonic.net -- Bug 225221
$dbh->bz_add_column('longdescs', 'comment_id',
- {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ {TYPE => 'INTSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
_stop_storing_inactive_flags();
_change_short_desc_from_mediumtext_to_varchar();
@@ -592,7 +592,7 @@ sub update_table_definitions {
_fix_series_creator_fk();
# 2009-11-14 dkl@redhat.com - Bug 310450
- $dbh->bz_add_column('bugs_activity', 'comment_id', {TYPE => 'INT3'});
+ $dbh->bz_add_column('bugs_activity', 'comment_id', {TYPE => 'INT4'});
# 2010-04-07 LpSolit@gmail.com - Bug 69621
$dbh->bz_drop_column('bugs', 'keywords');
@@ -691,6 +691,9 @@ sub update_table_definitions {
{TYPE => 'INTSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ # 2012-07-24 dkl@mozilla.com - Bug 776982
+ _fix_longdescs_primary_key();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3712,6 +3715,16 @@ sub _fix_notnull_defaults {
}
}
+sub _fix_longdescs_primary_key {
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info('longdescs', 'comment_id')->{TYPE} ne 'INTSERIAL') {
+ $dbh->bz_drop_related_fks('longdescs', 'comment_id');
+ $dbh->bz_alter_column('bugs_activity', 'comment_id', {TYPE => 'INT4'});
+ $dbh->bz_alter_column('longdescs', 'comment_id',
+ {TYPE => 'INTSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ }
+}
+
1;
__END__