chg: [server:dbSchemaDiagnostic] Support of display width and updated

`db_schema.json`
pull/5767/head
mokaddem 2020-03-31 09:02:17 +02:00
parent bb47410b9f
commit 2bae36f214
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 728 additions and 16 deletions

View File

@ -4486,7 +4486,10 @@ class Server extends AppModel
if (isset($field['error_type'])) {
$length = false;
if (in_array($field['error_type'], array('missing_column', 'column_different'))) {
if ($field['expected']['data_type'] === 'int') {
preg_match('/([a-z]+)(?:\((?<dw>[0-9,]+)\))?\s*([a-z]+)?/i', $field['expected']['column_type'], $displayWidthMatches);
if (isset($displayWidthMatches['dw'])) {
$length = $displayWidthMatches[2];
} elseif ($field['expected']['data_type'] === 'int') {
$length = 11;
} elseif ($field['expected']['data_type'] === 'tinyint') {
$length = 1;
@ -4592,6 +4595,7 @@ class Server extends AppModel
'numeric_precision',
// 'datetime_precision', -- Only available on MySQL 5.6+
'collation_name',
'column_type',
'column_default'
)
){

File diff suppressed because it is too large Load Diff