diff --git a/src/QueryBuilder/AbstractColumnDefinitionBuilder.php b/src/QueryBuilder/AbstractColumnDefinitionBuilder.php index 2e50ae3f6..b0894c30f 100644 --- a/src/QueryBuilder/AbstractColumnDefinitionBuilder.php +++ b/src/QueryBuilder/AbstractColumnDefinitionBuilder.php @@ -254,7 +254,10 @@ protected function buildType(ColumnInterface $column): string { $dbType = $this->getDbType($column); - if (empty($dbType) || $dbType[-1] === ')' || !$this->isAllowSize($dbType)) { + if (empty($dbType) + || $dbType[-1] === ')' + || !in_array(strtolower($dbType), static::TYPES_WITH_SIZE, true) + ) { return $dbType; } @@ -266,7 +269,7 @@ protected function buildType(ColumnInterface $column): string $scale = $column->getScale(); - if ($scale === null || !$this->isAllowScale($dbType)) { + if ($scale === null || !in_array(strtolower($dbType), static::TYPES_WITH_SCALE, true)) { return "$dbType($size)"; } @@ -305,20 +308,4 @@ protected function getDefaultUuidExpression(): string { return ''; } - - /** - * Check if the database column type allow scale specification. - */ - protected function isAllowScale(string $dbType): bool - { - return in_array(strtolower($dbType), static::TYPES_WITH_SCALE, true); - } - - /** - * Check if the database column type allow size specification. - */ - protected function isAllowSize(string $dbType): bool - { - return in_array(strtolower($dbType), static::TYPES_WITH_SIZE, true); - } }