Skip to content

Commit

Permalink
additional extension fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
justdave committed May 11, 2024
1 parent e233b16 commit 5c13733
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bugzilla/Install/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ sub _update_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";
warn "Dropping foreign keys on $fix->{table}\n";
$dbh->bz_drop_related_fks($fix->{table}, $fix->{column});
$def->{TYPE} = 'INT3';
$dbh->bz_alter_column($fix->{table}, $fix->{column}, $def);
Expand Down
13 changes: 12 additions & 1 deletion extensions/FlagTypeComment/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub db_schema_abstract_schema {
$args->{'schema'}->{'flagtype_comments'} = {
FIELDS => [
type_id => {
TYPE => 'INT2',
TYPE => 'INT3',
NOTNULL => 1,
REFERENCES => {TABLE => 'flagtypes', COLUMN => 'id', DELETE => 'CASCADE'}
},
Expand All @@ -53,6 +53,17 @@ sub db_schema_abstract_schema {
};
}

sub install_update_db {
# Bug 1634711 - [email protected]
my $def = $dbh->bz_column_info('flagtype_comments', 'type_id');
if ($def->{TYPE} eq 'INT2') {
warn "Dropping foreign keys on flagtype_comments\n";
$dbh->bz_drop_related_fks('flagtype_comments', 'type_id');
$def->{TYPE} = 'INT3';
$dbh->bz_alter_column('flagtype_comments', 'type_id', $def);
}
}

#############
# Templates #
#############
Expand Down
9 changes: 9 additions & 0 deletions extensions/Review/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,15 @@ sub install_update_db {

# Bug 1588221 - [email protected]
$dbh->bz_alter_column('flag_state_activity', 'attachment_id', {TYPE => 'INT5'});

# Bug 1634711 - [email protected]
my $def = $dbh->bz_column_info('flag_state_activity', 'type_id');
if ($def->{TYPE} eq 'INT2') {
warn "Dropping foreign keys on flag_state_activity\n";
$dbh->bz_drop_related_fks('flag_state_activity', 'type_id');
$def->{TYPE} = 'INT3';
$dbh->bz_alter_column('flag_state_activity', 'type_id', $def);
}
}

sub install_filesystem {
Expand Down

0 comments on commit 5c13733

Please sign in to comment.