db2 driver updates

This commit is contained in:
Mark Gregory
2026-11-11 11:11:30 +00:00
parent 984b52f39e
commit 84844311a5
8 changed files with 1051 additions and 4 deletions
+4 -1
View File
@@ -136,12 +136,15 @@ class Db2SchemaBuilder extends Builder
);
return array_map(static function ($row) {
$type = trim($row->TYPENAME);
$typeName = trim($row->TYPENAME);
$type = $typeName === 'CHARACTER' ? 'CHAR' : $typeName;
if (in_array(strtoupper($type), ['VARCHAR', 'CHAR', 'VARGRAPHIC', 'GRAPHIC'])) {
$type .= '(' . (int) $row->LENGTH . ')';
} elseif (in_array(strtoupper($type), ['DECIMAL', 'NUMERIC'])) {
$type .= '(' . (int) $row->LENGTH . ',' . (int) $row->SCALE . ')';
} elseif (strtoupper($type) === 'TIMESTAMP') {
$type .= '(' . (int) $row->SCALE . ')';
}
return [