mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Remove unnecessary size from int/bigint types
This commit is contained in:
parent
43c5da7818
commit
c97b161e42
1 changed files with 12 additions and 0 deletions
|
|
@ -19,6 +19,14 @@ class DBTableParser
|
|||
'date' => 'char(14)',
|
||||
);
|
||||
|
||||
/**
|
||||
* List of types for which the size attribute will be ignored.
|
||||
*/
|
||||
protected static $_nosize_types = array(
|
||||
'bigint' => true,
|
||||
'int' => true,
|
||||
);
|
||||
|
||||
/**
|
||||
* Load a table definition XML file.
|
||||
*
|
||||
|
|
@ -68,6 +76,10 @@ class DBTableParser
|
|||
$column->size = strval($column_info['size']);
|
||||
}
|
||||
$column->size = implode(',', array_map('trim', explode(',', $column->size))) ?: null;
|
||||
if (isset(self::$_nosize_types[$column->type]))
|
||||
{
|
||||
$column->size = null;
|
||||
}
|
||||
|
||||
// Get the utf8mb4 attribute.
|
||||
if (isset($column_info['utf8mb4']))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue