Repository navigation
Why double and decimal columns changed? #50714
|
Working with Laravel 11, I noticed a change in the column types for double and decimal. I am wondering why and I would love if someone can explain why the new way is better: Here are screenshots and texts from the official doc to help explain the change. From Laravel 11, only the decimal column had the precision and scale The decimal method creates a DECIMAL equivalent column with the given precision (total digits) and scale (decimal digits): The double method creates a DOUBLE equivalent column: From Laravel 10, both the decimal and double column had the precision and scale The decimal method creates a DECIMAL equivalent column with the given precision (total digits) and scale (decimal digits): The double method creates a DOUBLE equivalent column with the given precision (total digits) and scale (decimal digits): Thank you. |
Replies: 1 comment 1 reply
|
Decimal type has not been changed, just float and double types have been rewritten to be consistent across all databases. You may check the explaination on the upgrade guide: And also the releared PR: #48861 |


Decimal type has not been changed, just float and double types have been rewritten to be consistent across all databases.
You may check the explaination on the upgrade guide:
https://laravel.com/docs/11.x/upgrade#floating-point-types
And also the releared PR: #48861