mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor:完善 MySQL 无默认值字段类型列表
This commit is contained in:
parent
9daaa178c8
commit
932346febe
@ -403,9 +403,16 @@ class Helper
|
||||
if (!is_null($phinxTypeData['limit'])) {
|
||||
$phinxColumnOptions['limit'] = $phinxTypeData['limit'];
|
||||
}
|
||||
if ($field['default'] != 'none' && !in_array($conciseType, ['text', 'blob'])) {
|
||||
|
||||
// 无默认值字段
|
||||
$noDefaultValueFields = [
|
||||
'text', 'blob', 'geometry', 'geometrycollection', 'json', 'linestring', 'longblob', 'longtext', 'mediumblob',
|
||||
'mediumtext', 'multilinestring', 'multipoint', 'multipolygon', 'point', 'polygon', 'tinyblob',
|
||||
];
|
||||
if ($field['default'] != 'none' && !in_array($conciseType, $noDefaultValueFields)) {
|
||||
$phinxColumnOptions['default'] = self::analyseFieldDefault($field);
|
||||
}
|
||||
|
||||
$phinxColumnOptions['null'] = (bool)$field['null'];
|
||||
$phinxColumnOptions['comment'] = $field['comment'];
|
||||
$phinxColumnOptions['signed'] = !$field['unsigned'];
|
||||
|
Loading…
Reference in New Issue
Block a user