phalcon / phalcon-devtools

Phalcon Developer Tools
https://docs.phalcon.io/latest/en/devtools
Other
1.33k stars 630 forks source link

Wrong migration for Column::TYPE_DECIMAL #1444

Closed 1vanov closed 3 years ago

1vanov commented 4 years ago

ERROR: SQLSTATE[42000]: Syntax error or access violation: 1427 For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'discount')

Here're the migration files for the same table, but with different versions of devtools:

phlacon-devtools 3 (working):

'type' => Column::TYPE_DECIMAL,
'default' => "0.00",
'size' => 13,
'scale' => 2

phlacon-devtools 4 (not working):

'type' => Column::TYPE_DECIMAL,
'default' => "0.00",
'notNull' => false,
'scale' => 2,

As you can see, in the new migration I made using the updated devtools, there's no 'size' attribute for decimal type column, this causes an error.

Jeckerson commented 3 years ago

Will be fixed when phalcon/migrations will be updated to v2.x

Jeckerson commented 3 years ago

Related #1464

Jeckerson commented 3 years ago

Closing in favor #1464