# Prisma 4.0.0 — Release & Upgrade Intelligence
- **Product:** Prisma (https://prisma.io)
- **Version:** 4.0.0
- **Released:** Jun 28, 2022
- **Impact Score:** 7/10
- **Breaking Changes:** Source flagged
- **Canonical Analysis:** https://changelogs.us/prisma/updates/4.0.0/

## Executive Summary (TL;DR)
Prisma 4.0.0. Source highlight: We're excited to share the `4.0.0` stable release today. 🎉

## Breaking Changes & Deprecations
- As this is a major release, we included many breaking bug fixes and other enhancements, but we believe upgrading is worthwhile. You can learn about upgrading in our [Prisma 4 Upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4) and the [Prisma 4 Upgrade video](https://www.youtube.com/watch?v=FSjkBrfaoEY).
- ⚠️ Breaking change:** If you previously configured the index properties at the database level, refer to the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#index-configuration) for a detailed explanation and steps to follow.
- This change introduces two major improvements (both breaking, refer to the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4) for a smooth upgrade) when working with raw queries with Prisma:
- ⚠️ Breaking change:** To learn how you can smoothly upgrade to version `4.0.0`, refer to our upgrade guide: [Raw query type mapping: scalar values are now deserialized as their correct JavaScript types](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#raw-query-type-mapping-scalar-values-are-now-deserialized-as-their-correct-javascript-types) and [Raw query mapping: PostgreSQL type-casts](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#raw-query-mapping-postgresql-type-casts).
- ⚠️ Breaking change:** Refer to the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#scalar-list-defaults) for a detailed explanation and steps to follow.
- ⚠️ Breaking change:** Refer to our [upgrade guide](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types#default-values-for-required-fields-on-composite-types) for detailed explanation and steps when working with default fields on composite types in MongoDB from version `4.0.0`.
- ⚠️ Breaking change:** Refer to our [upgrade path](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#explicit-unique-constraints-on-one-to-one-relations) for a detailed explanation and steps to follow.
- ⚠️ Breaking change:** Refer to the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4#remove-references-syntax-for-implicit-many-to-many-relations) for a detailed explanation and steps to follow.

## New Features
- **Preview features moved to General Availability**

## Improvements
- **Improvements to the Prisma Schema**
- Defaults values for scalar lists (arrays)
- Improved default support for embedded documents in MongoDB
- Explicit unique constraints for 1:1 relations
- Removed support for usage of `references` on implicit m:n relations
- Enforcing uniqueness of referenced fields in the `references` argument in 1:1 and 1:m relations for MySQL

## Bug Fixes
- Fix rounding errors on big numbers in SQLite
- PSL: define the grammar of string literals
- MySQL: Update default `statement_cache_size`
- You cannot define an index on fields with Native type Text of MySQL.
- Removal of undocumented support for `type` alias with Prisma 4.0.0
- `@unique` is added during Re-Introspection

## Upgrade Command
```bash
npm install --save-dev --save-exact prisma@4.0.0
```
