github prisma/prisma 2.19.0

latest releases: 5.22.0, 5.21.1, 5.21.0...
3 years ago

Today, we are excited to share the 2.19.0 stable release 🎉

🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟 

Major improvements & new features

Prisma Migrate is now ready for General Availability 🚀

We are excited to announce that Prisma Migrate enters General Availability. You can learn more about the launch in the announcement article.

There are no major changes to how Prisma Migrate works except that the --preview-feature flag is being removed:

Before v2.19.0

npx prisma migrate <COMMAND> --preview-feature

# for example:
npx prisma migrate dev --preview-feature

Now

npx prisma migrate <COMMAND>

# for example:
npx prisma migrate dev

Besides making Prisma Migrate ready for production in this release, it comes with a number of smaller fixes and improvements:

  • After migrate dev, migrate reset and db push, generation is always triggered to avoid issues where the Prisma Client API is outdated due to changes in relation names which have an impact on the database schema (GitHub issue)
  • Improve UX when migrate dev produces warnings (GitHub issue)
  • Better error when adding a new required field and the default value is Prisma-level, e.g. uuid()
  • Small improvement where Prisma Migrate failed to create the database on DigitalOcean
  • Bugfix: Fix a bug when there are foreign keys referencing missing tables that resulted in a crash
  • Bugfix: Improvement when changing a field from type String to Enum (MySQL, PostgreSQL)
  • Bugfix: Improvement when migrating enums and a default enum value is defined (PostgreSQL)

📚 Documentation:

Order by aggregates of relations in Prisma Client queries (Preview)

This release makes it possible to order by the aggregates (e.g. count) of relations in your Prisma Client queries. Here's is an example that orders a list of users by the number of the posts they created:

const orderedUsers = await prisma.user.findMany({
  orderBy: {
    posts: {
      count: 'asc'
    }
  }
})

This feature is released in Preview which means you have to explicitly enable it via the orderByRelation feature flag in your Prisma schema:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["orderByRelation"]
}

Don't forget to run npx prisma generate after you've added the feature flag to your Prisma schema so that the Prisma Client API gets updated accordingly.

Prisma Client Go now returns results from the Transaction API

Previously in the Go Client, you could write data within a transaction, but you couldn't get the results back from the transaction. Now you can! Learn more in the documentation.

Fixes and improvements

Prisma Client

Prisma Migrate

Language tools (e.g. VS Code)

Prisma Studio

Credits

Huge thanks to @endor, @iBluemind, @meeq for their help in this release! ✨

💼 Learn about Enterprise use cases of Prisma on March 25th

We hope you join us for the upcoming Prisma Enterprise Event on Thursday, March 25th which is centered around the following topics:

  • Learn how top companies are addressing the challenges of data at scale
  • Discover how companies use Prisma to make their developers more productive
  • Get a better understanding of the future of data in the enterprise

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.

The stream takes place on Youtube on Thursday, March 18 at 5pm Berlin | 8am San Francisco.

Don't miss a new prisma release

NewReleases is sending notifications on new releases.