Skip to content

Commit 9fa0d6b

Browse files
committed
Report the types of the fields that differ.
For example, the checkbox label will now say "Change type of field from INT to BIGINT when upgrading" if the type of the field in the database is INT and the type in the schema is BIGINT.
1 parent 47e5999 commit 9fa0d6b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/WeBWorK/ContentGenerator/CourseAdmin.pm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,11 @@ sub formatReportOnDatabaseTables ($c, $dbStatus, $courseID = undef) {
28082808
"$courseID.$table.fix_type_fieldIDs" => $key,
28092809
class => 'form-check-input'
28102810
),
2811-
$c->maketext('Change type of field when upgrading')
2811+
$c->maketext(
2812+
'Change type of field from [_1] to [_2] when upgrading',
2813+
$fieldInfo{$key}[1],
2814+
$fieldInfo{$key}[2]
2815+
)
28122816
)->join('')
28132817
)
28142818
)

lib/WeBWorK/Utils/CourseDBIntegrityCheck.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ sub checkTableFields {
234234
} else {
235235
my $data_type = $database_fields{$field_name}[1];
236236
$data_type =~ s/\(\d*\)$// if $data_type =~ /^(big|small)?int\(\d*\)$/;
237-
$data_type = lc($data_type);
238-
my $schema_data_type = lc($db->{$table}{record}->FIELD_DATA->{$field_name}{type} =~ s/ .*$//r);
237+
$data_type = uc($data_type);
238+
my $schema_data_type = uc($db->{$table}{record}->FIELD_DATA->{$field_name}{type} =~ s/ .*$//r);
239239
if ($data_type ne $schema_data_type) {
240-
$fieldStatus{$field_name} = [DIFFER_IN_A_AND_B];
240+
$fieldStatus{$field_name} = [ DIFFER_IN_A_AND_B, $data_type, $schema_data_type ];
241241
$fields_ok = 0;
242242
}
243243
}

0 commit comments

Comments
 (0)