-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1526703 - Increase the size of the flagtype id column
- Loading branch information
Showing
2 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,9 +483,8 @@ sub update_table_definitions { | |
$dbh->bz_drop_column('profiles', 'refreshed_when'); | ||
$dbh->bz_drop_column('groups', 'last_changed'); | ||
|
||
# 2006-08-06 [email protected] - Bug 347521 | ||
$dbh->bz_alter_column('flagtypes', 'id', | ||
{TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); | ||
# 2019-01-31 [email protected] - Bug TODO | ||
_update_flagtypes_id(); | ||
|
||
$dbh->bz_alter_column('keyworddefs', 'id', | ||
{TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); | ||
|
@@ -906,6 +905,30 @@ sub _update_product_name_definition { | |
} | ||
} | ||
|
||
sub _update_flagtypes_id { | ||
my $dbh = Bugzilla->dbh; | ||
my @fixes = ( | ||
{table => 'flaginclusions', column => 'type_id'}, | ||
{table => 'flagexclusions', column => 'type_id'}, | ||
{table => 'flags', column => 'type_id'}, | ||
); | ||
my $flagtypes_def = $dbh->bz_column_info('flagtypes', 'id'); | ||
foreach my $fix (@fixes) { | ||
my $def = $dbh->bz_column_info($fix->{table}, $fix->{column}); | ||
if ($def->{TYPE} eq 'INT2') { | ||
warn "Dropping $fix->{table}\n"; | ||
$dbh->bz_drop_related_fks($fix->{table}, $fix->{column}); | ||
$def->{TYPE} = 'INT3'; | ||
$dbh->bz_alter_column($fix->{table}, $fix->{column}, $def); | ||
} | ||
} | ||
|
||
if ($flagtypes_def->{TYPE} eq 'SMALLSERIAL') { | ||
$flagtypes_def->{TYPE} = 'MEDIUMSERIAL'; | ||
$dbh->bz_alter_column('flagtypes', 'id', $flagtypes_def); | ||
} | ||
} | ||
|
||
# A helper for the function below. | ||
sub _write_one_longdesc { | ||
my ($id, $who, $when, $buffer) = (@_); | ||
|