A developer performs a technical walkthrough to upgrade an application to Prisma 7. The process includes configuring prisma.config.ts, updating schema definitions, modifying service constructors with PostgreSQL connection pools, and adjusting Docker files and compose configurations for production deployment.
Length 9:09
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #prisma #postgresql #typescript #docker #nest.js #database #migration #programming #software engineering #code
0:00 All right, so in this latest lecture, we've updated all of our dependencies in 0:03 our 0:04 Prisma branch, and this includes Prisma at V seven. 0:08 Now, Prisma V seven introduces a few breaking 0:10 changes to how we've 0:12 previously configured Prisma. And so in this lecture, we're gonna walk 0:15 through these changes to see how you can upgrade your application. 0:19 So I'm gonna leave a link below to these changes to the repository 0:22 that show you the exact changes we made in this commit, so you can review all of 0:26 them, but let's go ahead and jump in to see the changes. 0:30 Now, the primary change here in Prisma is if we go to Auth, for 0:34 example, where we know we have Prisma set up, 0:37 you'll notice that we now have a new file called 0:40 prisma.config.ts here at the root. 0:44 Now, in Prisma V seven, we have this new file, which 0:46 is sort of like 0:47 Drizzle config, if you've used Drizzle before, 0:49 where we define 0:51 configuration inside of TypeScript directly. 0:54 So you can see here we're importing dot env, which is the actual 0:58 library that NestJS config uses under the hood to load environment 1:02 variables. And so this is the default configuration we import 1:06 from Prisma config. Define this config 1:09 file where we define the path to our schemas, 1:13 the path to our migrations, 1:16 and finally, data source where we actually provide the 1:19 database 1:20 connection URL. 1:22 Now, you can use the env function from Prisma, 1:24 which will use dot env under the 1:26 hood to extract an environment variable. 1:28 So in this case, we're extracting our database URL, 1:32 which we know we've set 1:32 up to point to our PostgreSQL DB. Now, importantly, there are some 1:36 additional dependencies we need for this Prisma seven integration. 1:41 So make sure you have pg installed, which is a Node
The rest of the transcript is for members.
Sign in