Skip to content

v8.0.0-rc.9

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Sep 17:06
f889eeb

v8.0.0-rc.9

This RC tightens schema validation, adds reusable query-filter types, and fixes language-server diagnostics and PostgreSQL migration verification.

Breaking changes

  • Text-backed enum ordering follows stored values. PostgreSQL ORDER BY and DISTINCT ON no longer impose enum declaration order. If semantic ranking matters, use an explicit ranking expression or numeric enum values; native PostgreSQL enums retain their database ordering. Changing existing storage to numeric values requires a data-preserving migration, including defaults and constraints—not rewriting applied migration history. See the app upgrade recipe. (#30223)

  • MongoDB index arguments use native schema values. Replace encoded wildcard-index include/exclude strings with string lists and encoded text-index weights strings with records. Weights must be integers from 1 to 99,999; malformed and unsupported arguments now fail validation. The filter argument remains quoted JSON. See the app upgrade recipe. (#29833)

    Before:

    @@index([wildcard()], include: "[metadata, nested.path]")
    @@textIndex([title, body], weights: "{\"title\": 10, \"body\": 5}")

    After:

    @@index([wildcard()], include: ["metadata", "nested.path"])
    @@textIndex([title, body], weights: { title: 10, body: 5 })
  • MongoDB rejects previously ignored attributes. Remove unsupported @default, @updatedAt, and @db.* attributes from MongoDB schemas only. They never produced defaults or timestamps in the MongoDB contract; these remain application responsibilities. Unknown model and field attributes now fail emission, and @id/@unique reject arguments. See the app upgrade recipe for schema migration. (#30160)

    Before:

    status ProductStatus @default(Active)
    updatedAt DateTime @updatedAt

    After:

    status ProductStatus
    updatedAt DateTime
  • Reusable SQL ORM filter types require a namespace. Update ShorthandWhereFilter, RelationPredicate, RelationPredicateInput, and RelationFilterAccessor to use <Contract, Namespace, Model>. Existing three-argument shorthand annotations must reorder their model and namespace arguments. See the app upgrade recipe and extension upgrade recipe. (#30158)

    Before:

    ShorthandWhereFilter<Contract, 'User'>

    After:

    ShorthandWhereFilter<Contract, 'public', 'User'>
  • SQL ORM upsert and batch-create inputs reject nested relation callbacks. upsert({ create }), createAll(), and createAndCount() no longer accept callbacks they cannot execute. Use ordinary create() when nested creation is intended, or create related records separately when retaining upsert or batch behavior. See the upgrade recipe. (#30144)

  • Language-server support requires the schema directive. Put // use prisma-next before other non-whitespace content in each Prisma 8 schema file to retain diagnostics, completion, formatting, and other language-server features. Unmarked files are excluded from this server's schema composition. (#30140)

Features

  • Extract reusable, fully typed SQL-builder predicates with WhereFilter<Contract, Namespace, Table>, exported from @prisma/orm-postgres/builder/types. (#30158)
  • PostgreSQL numeric enums now derive membership CHECK constraints for scalar and array columns. (#30223)

Fixes

  • Valid schemas, including those generated by prisma orm init, no longer receive false attribute diagnostics when the language server and project interpreter load separate parser copies. Update project ORM packages to receive the fix. (#30228)
  • Ordering native PostgreSQL enum columns no longer fails with an array_position(text[], enum) error. (#30191)
  • PostgreSQL int8 literal defaults compare correctly during migration verification when introspection returns decimal strings and the contract uses safe-integer numbers. (#30194)
  • Codec factories preserve their descriptor receiver, preventing codec-ID crashes from masking useful encoding and decoding errors. (#30222)
  • Schema validation errors now list accepted functions, such as now() and uuid(), instead of repeating “function call.” (#30224)
  • CLI help, diagnostics, telemetry notices, and generated project documentation consistently use “Prisma ORM.” (#30192)