Error on numerics with custom decimals after update to 3.3.7 | Laravel 9

0 votes
asked Apr 3, 2024 in Bug report by upsite (140 points)

I have a field with type decimal and decimal set to 3.

before update:
$table->decimal('weight', 8, 3)->nullable(true)->after('value')->change();

after update:
$table->decimal('weight', 3)->nullable(true)->after('value')->change();
error:

Numeric value out of range: 1264 Out of range value for column 'weight' at row 300 (SQL: ALTER TABLE amounts CHANGE weight weight NUMERIC(3, 2) DEFAULT NULL)

enter image description here

commented Apr 3, 2024 by ludek.vodicka Skipper developer (140,450 points)

This is not a bug, it's a "feature". Skipper no longer exports 8,3 as default values to every decimal, because this could lead to wrong behavior.

Now you need to fill both, "decimal" and "size" to get expected 8,3 values.

Please log in or register to answer this question.

...