Changes to the default mapping of Float in Prisma 2.17.0

Опубликовано: 29 Сентябрь 2024
на канале: Prisma
3,002
38

In previous versions of Prisma, the Float type in the Prisma schema would map to the Decimal type in MySQL and PostgreSQL. Version 2.17 of Prisma brings two changes relevant changes:
- Float in the Prisma schema will map to Double in the database
- The Decimal Prisma scalar type is available in GA and can be used to avoid altering the existing decimal columns in the database. Prisma Client will now return Decimal.js objects for fields with the type Decimal in the Prisma schema.

In this video, Daniel shows how to upgrade to version 2.17.0 while addressing the breaking changes.

00:00 - Intro
00:27 - Changes in 2.17.0: Native types and remapping of Float
02:07 - Upgrading to 2.17
02:50 - Adjusting the Prisma schema manually to avoid altering the DB schema
03:35 - Adjusting the Prisma schema with introspection to avoid altering the DB schema
03:46 - Updating application code to use the Decimal.js
05:50 - Explanation for the remapping
06:50 - Recap

------------------------
Next:
👉 Check Previous video: Using Prisma's Group By Feature -    • Using Prisma's Group By Feature  
👉 Check Next video: Upgrading to Prisma Migrate Preview from the Experimental version -    • Upgrading to Prisma Migrate Preview f...  

------------------------
📚 Resources:

✅ Subscribe to Prisma:    / @prismadata  
✅ Learn more about Prisma:
◭ Website: https://www.prisma.io
◭ Docs: https://www.prisma.io/docs
◭ Quickstart: https://pris.ly/qstart

------------------------
💬 Connect with Prisma:
Twitter:   / prisma  
Discord: https://pris.ly/discord
LinkedIn:   / prisma-io