Skip to content

Commit c9f214d

Browse files
authored
Fix Decimal Column Definition Issue When Scale is 0 (#2377)
1 parent 21cee19 commit c9f214d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Phinx/Db/Adapter/MysqlAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ protected function getColumnSqlDefinition(Column $column): string
13551355
$sqlType = $this->getSqlType($column->getType(), $column->getLimit());
13561356
$def = strtoupper($sqlType['name']);
13571357
}
1358-
if ($column->getPrecision() && $column->getScale()) {
1358+
if ($column->getPrecision() && $column->getScale() !== null) {
13591359
$def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')';
13601360
} elseif (isset($sqlType['limit'])) {
13611361
$def .= '(' . $sqlType['limit'] . ')';

0 commit comments

Comments
 (0)