summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-04-01 10:13:16 +0200
committerByron Jones <glob@mozilla.com>2014-04-01 10:13:16 +0200
commitb42469e3632fe96b0475fa00f07d6ca5abc0e2dc (patch)
tree4a2e057225d7f756b30ba8acbea015482044c648 /Bugzilla/Install
parent72e6a203547667b442c876f9cbfa9cce72e8f814 (diff)
downloadbugzilla-b42469e3632fe96b0475fa00f07d6ca5abc0e2dc.tar.gz
bugzilla-b42469e3632fe96b0475fa00f07d6ca5abc0e2dc.tar.xz
Bug 981756: add support for "bigint unsigned" to db/schema and update bz_schema to reflect the current state
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm30
1 files changed, 27 insertions, 3 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index ad68e94c4..a217e0753 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -261,7 +261,7 @@ sub update_table_definitions {
$dbh->bz_add_column("bugs", "cclist_accessible",
{TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE'});
- $dbh->bz_add_column("bugs_activity", "attach_id", {TYPE => 'INT3'});
+ $dbh->bz_add_column("bugs_activity", "attach_id", {TYPE => 'INT5'});
_delete_logincookies_cryptpassword_and_handle_invalid_cookies();
@@ -686,8 +686,9 @@ sub update_table_definitions {
{TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
# 2012-07-24 dkl@mozilla.com - Bug 776972
- $dbh->bz_alter_column('bugs_activity', 'id',
- {TYPE => 'INTSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ # BMO - we change this to BIGSERIAL further down
+ #$dbh->bz_alter_column('bugs_activity', 'id',
+ # {TYPE => 'INTSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
# 2012-07-24 dkl@mozilla.com - Bug 776982
@@ -705,6 +706,14 @@ sub update_table_definitions {
# 2013-08-16 glob@mozilla.com - Bug 905925
$dbh->bz_add_index('attachments', 'attachments_ispatch_idx', ['ispatch']);
+ # 2014-03-11 glob@mozilla.com - Bug 981756 (BMO only)
+ _fix_attachments_primary_key();
+ if ($dbh->bz_column_info('bugs_activity', 'id')->{TYPE} ne 'BIGSERIAL') {
+ $dbh->bz_drop_related_fks('bugs_activity', 'id');
+ $dbh->bz_alter_column('bugs_activity', 'id',
+ {TYPE => 'BIGSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ }
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3736,6 +3745,21 @@ sub _fix_longdescs_primary_key {
}
}
+sub _fix_attachments_primary_key {
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info('attachments', 'attach_id')->{TYPE} ne 'BIGSERIAL') {
+ $dbh->bz_drop_related_fks('attachments', 'attach_id');
+ $dbh->bz_alter_column('attach_data', 'id', {TYPE => 'INT5'});
+ $dbh->bz_alter_column('bugs_activity', 'attach_id', {TYPE => 'INT5'});
+ $dbh->bz_alter_column('flags', 'attach_id', {TYPE => 'INT5'});
+ # the following two are bmo extensions
+ $dbh->bz_alter_column('flag_state_activity', 'attachment_id', {TYPE => 'INT5'});
+ $dbh->bz_alter_column('autoland_attachments', 'attach_id', {TYPE => 'INT5'});
+ $dbh->bz_alter_column('attachments', 'attach_id',
+ {TYPE => 'BIGSERIAL', NOTNULL => 1, PRIMARYKEY => 1});
+ }
+}
+
sub _fix_dependencies_dupes {
my $dbh = Bugzilla->dbh;
my $blocked_idx = $dbh->bz_index_info('dependencies', 'dependencies_blocked_idx');