You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,34 @@ const adapter = new PrismaBetterSqlite3({
212
212
exportconst prisma =newPrismaClient({ adapter })
213
213
```
214
214
215
+
### Prisma Accelerate users upgrading from v6
216
+
If you used Prisma Accelerate (including Prisma Postgres' `prisma+postgres://` URLs) in v6, keep using the Accelerate URL with the Accelerate extension. Do **not** pass the Accelerate URL to a driver adapter—`PrismaPg` expects a direct database connection string and will fail with `prisma://` or `prisma+postgres://`.
217
+
218
+
1. Keep your Accelerate URL in `.env` (for example `DATABASE_URL="prisma://..."` or `prisma+postgres://...`).
219
+
2. You can point `prisma.config.ts` directly to that same Accelerate URL for CLI operations:
220
+
```ts file=prisma.config.ts
221
+
import'dotenv/config'
222
+
import { defineConfig, env } from'prisma/config'
223
+
224
+
exportdefaultdefineConfig({
225
+
schema: 'prisma/schema.prisma',
226
+
datasource: {
227
+
url: env('DATABASE_URL'),
228
+
},
229
+
})
230
+
```
231
+
- If you prefer a separate direct URL for migrations, you can still use `DIRECT_DATABASE_URL` as above—but it's optional for Accelerate users.
232
+
3. Instantiate Prisma Client with the Accelerate URL and extension (no adapter):
If you later switch away from Accelerate to direct TCP, provide the direct URL to the appropriate driver adapter (for example `PrismaPg`) instead of `accelerateUrl`.
242
+
215
243
### Explicit loading of environment variables
216
244
In Prisma ORM 7.0.0, environment variables are not loaded by default. Instead developers need to
217
245
explicitly load the variables when calling the `prisma` CLI. Libraries like [`dotenv`](https://github.com/motdotla/dotenv) can be used to manage loading environment variables by reading the appropriate `.env` file.
0 commit comments