diff --git a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/200-shadow-database.mdx b/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/200-shadow-database.mdx
index 765ed01f61..7b04e77bc1 100644
--- a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/200-shadow-database.mdx
+++ b/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/200-shadow-database.mdx
@@ -81,9 +81,32 @@ In some cases it might make sense (e.g. when [creating and dropping databases is
1. Create a dedicated database that should be used as the shadow database
2. Add the connection string of that database your environment variable `SHADOW_DATABASE_URL` (or `.env` file)
-3. Add the [`shadowDatabaseUrl`](/orm/reference/prisma-schema-reference#datasource) field reading this environment variable:
+3. In Prisma 7, configure the `shadowDatabaseUrl` field in `prisma.config.ts` under the `datasource` object. In Prisma 6 and below, add the `shadowDatabaseUrl` field to the `datasource` block in your `schema.prisma` file.
+
+
+
+
+```ts
+import "dotenv/config";
+import { defineConfig, env } from "prisma/config";
+
+export default defineConfig({
+ schema: "prisma/schema.prisma",
+ migrations: {
+ path: "prisma/migrations",
+ },
+ datasource: {
+ url: env("DATABASE_URL"),
+ //highlight-next-line
+ shadowDatabaseUrl: env("SHADOW_DATABASE_URL"),
+ },
+});
+```
+
+
+
-```prisma highlight=4;normal
+```prisma
datasource db {
provider = "postgresql"
//highlight-next-line
@@ -91,6 +114,9 @@ datasource db {
}
```
+
+
+
> **Important**: Do not use the exact same values for `url` and `shadowDatabaseUrl` as that might delete all the data in your database.
## Cloud-hosted shadow databases must be created manually
@@ -99,9 +125,32 @@ Some cloud providers do not allow you to drop and create databases with SQL. Som
1. Create a dedicated cloud-hosted shadow database
2. Add the URL to your environment variable `SHADOW_DATABASE_URL`
-3. Add the [`shadowDatabaseUrl`](/orm/reference/prisma-schema-reference#datasource) field reading this environment variable:
+3. In Prisma 7, configure the `shadowDatabaseUrl` field in `prisma.config.ts` under the `datasource` object. In Prisma 6 and below, add the `shadowDatabaseUrl` field to the `datasource` block in your `schema.prisma` file.
+
+
+
+
+```ts
+import "dotenv/config";
+import { defineConfig, env } from "prisma/config";
+
+export default defineConfig({
+ schema: "prisma/schema.prisma",
+ migrations: {
+ path: "prisma/migrations",
+ },
+ datasource: {
+ url: env("DATABASE_URL"),
+ //highlight-next-line
+ shadowDatabaseUrl: env("SHADOW_DATABASE_URL"),
+ },
+});
+```
+
+
+
-```prisma highlight=4;normal
+```prisma
datasource db {
provider = "postgresql"
//highlight-next-line
@@ -109,6 +158,9 @@ datasource db {
}
```
+
+
+
> **Important**: Do not use the same values for `url` and `shadowDatabaseUrl`.
## Shadow database user permissions