Commit 0c266590 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 531841: Change all hour-related database fields to decimal(7,3) so that they…

Bug 531841: Change all hour-related database fields to decimal(7,3) so that they can store numbers greater than 999.99 in modern versions of MySQL. Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
parent 8d2b07ea
...@@ -285,9 +285,9 @@ use constant ABSTRACT_SCHEMA => { ...@@ -285,9 +285,9 @@ use constant ABSTRACT_SCHEMA => {
NOTNULL => 1, DEFAULT => 'TRUE'}, NOTNULL => 1, DEFAULT => 'TRUE'},
cclist_accessible => {TYPE => 'BOOLEAN', cclist_accessible => {TYPE => 'BOOLEAN',
NOTNULL => 1, DEFAULT => 'TRUE'}, NOTNULL => 1, DEFAULT => 'TRUE'},
estimated_time => {TYPE => 'decimal(5,2)', estimated_time => {TYPE => 'decimal(7,2)',
NOTNULL => 1, DEFAULT => '0'}, NOTNULL => 1, DEFAULT => '0'},
remaining_time => {TYPE => 'decimal(5,2)', remaining_time => {TYPE => 'decimal(7,2)',
NOTNULL => 1, DEFAULT => '0'}, NOTNULL => 1, DEFAULT => '0'},
deadline => {TYPE => 'DATETIME'}, deadline => {TYPE => 'DATETIME'},
alias => {TYPE => 'varchar(20)'}, alias => {TYPE => 'varchar(20)'},
...@@ -395,7 +395,7 @@ use constant ABSTRACT_SCHEMA => { ...@@ -395,7 +395,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES => {TABLE => 'profiles', REFERENCES => {TABLE => 'profiles',
COLUMN => 'userid'}}, COLUMN => 'userid'}},
bug_when => {TYPE => 'DATETIME', NOTNULL => 1}, bug_when => {TYPE => 'DATETIME', NOTNULL => 1},
work_time => {TYPE => 'decimal(5,2)', NOTNULL => 1, work_time => {TYPE => 'decimal(7,2)', NOTNULL => 1,
DEFAULT => '0'}, DEFAULT => '0'},
thetext => {TYPE => 'LONGTEXT', NOTNULL => 1}, thetext => {TYPE => 'LONGTEXT', NOTNULL => 1},
isprivate => {TYPE => 'BOOLEAN', NOTNULL => 1, isprivate => {TYPE => 'BOOLEAN', NOTNULL => 1,
......
...@@ -593,8 +593,8 @@ sub update_table_definitions { ...@@ -593,8 +593,8 @@ sub update_table_definitions {
$dbh->bz_drop_column('products', 'milestoneurl'); $dbh->bz_drop_column('products', 'milestoneurl');
_add_allows_unconfirmed_to_product_table(); _add_allows_unconfirmed_to_product_table();
_convert_flagtypes_fks_to_set_null(); _convert_flagtypes_fks_to_set_null();
_fix_decimal_types();
################################################################ ################################################################
# New --TABLE-- changes should go *** A B O V E *** this point # # New --TABLE-- changes should go *** A B O V E *** this point #
...@@ -3354,6 +3354,14 @@ sub _convert_flagtypes_fks_to_set_null { ...@@ -3354,6 +3354,14 @@ sub _convert_flagtypes_fks_to_set_null {
} }
} }
sub _fix_decimal_types {
my $dbh = Bugzilla->dbh;
my $type = {TYPE => 'decimal(7,2)', NOTNULL => 1, DEFAULT => '0'};
$dbh->bz_alter_column('bugs', 'estimated_time', $type);
$dbh->bz_alter_column('bugs', 'remaining_time', $type);
$dbh->bz_alter_column('longdescs', 'work_time', $type);
}
1; 1;
__END__ __END__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment