diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-16 21:43:21 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-16 21:43:21 +0100 |
commit | 55430d087503640c7637ed8bdfe8765d5653dc85 (patch) | |
tree | f56c55d52f63a8ca0a4fa3c50d4970608001ae1e /Bugzilla/Install | |
parent | c1b82081c90926e701c4c9b2dc8ad65163663b42 (diff) | |
download | bugzilla-55430d087503640c7637ed8bdfe8765d5653dc85.tar.gz bugzilla-55430d087503640c7637ed8bdfe8765d5653dc85.tar.xz |
Last Comment Bug 685611 - delta_ts is updated even when no changes are made to bugs created via WebServices
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r-- | Bugzilla/Install/DB.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 84267de41..dff3c6d2e 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -29,6 +29,7 @@ use Bugzilla::Install::Util qw(indicate_progress install_string); use Bugzilla::Util; use Bugzilla::Series; use Bugzilla::BugUrl; +use Bugzilla::Field; use Date::Parse; use Date::Format; @@ -659,6 +660,9 @@ sub update_table_definitions { # 2011-10-11 miketosh - Bug 690173 _on_delete_set_null_for_audit_log_userid(); + # 2011-11-28 dkl@mozilla.com - Bug 685611 + _fix_notnull_defaults(); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -3614,6 +3618,31 @@ sub _on_delete_set_null_for_audit_log_userid { } } +sub _fix_notnull_defaults { + my $dbh = Bugzilla->dbh; + + $dbh->bz_alter_column('bugs', 'bug_file_loc', + {TYPE => 'MEDIUMTEXT', NOTNULL => 1, + DEFAULT => "''"}, ''); + + my $custom_fields = Bugzilla::Field->match({ + custom => 1, type => [ FIELD_TYPE_FREETEXT, FIELD_TYPE_TEXTAREA ] + }); + + foreach my $field (@$custom_fields) { + if ($field->type == FIELD_TYPE_FREETEXT) { + $dbh->bz_alter_column('bugs', $field->name, + {TYPE => 'varchar(255)', NOTNULL => 1, + DEFAULT => "''"}, ''); + } + if ($field->type == FIELD_TYPE_TEXTAREA) { + $dbh->bz_alter_column('bugs', $field->name, + {TYPE => 'MEDIUMTEXT', NOTNULL => 1, + DEFAULT => "''"}, ''); + } + } +} + 1; __END__ |