fix: MySQL text 和 blob 类型不能有默认值 !132

This commit is contained in:
尘梦_幻 2023-07-18 19:55:15 +00:00 committed by 妙码生花
parent f063d5dfaf
commit 9daaa178c8

View File

@ -403,7 +403,7 @@ class Helper
if (!is_null($phinxTypeData['limit'])) {
$phinxColumnOptions['limit'] = $phinxTypeData['limit'];
}
if ($field['default'] != 'none') {
if ($field['default'] != 'none' && !in_array($conciseType, ['text', 'blob'])) {
$phinxColumnOptions['default'] = self::analyseFieldDefault($field);
}
$phinxColumnOptions['null'] = (bool)$field['null'];