diff --git a/content/200-orm/050-overview/100-introduction/300-data-modeling.mdx b/content/200-orm/050-overview/100-introduction/300-data-modeling.mdx index 107ddf045b..39b09b516c 100644 --- a/content/200-orm/050-overview/100-introduction/300-data-modeling.mdx +++ b/content/200-orm/050-overview/100-introduction/300-data-modeling.mdx @@ -74,7 +74,7 @@ In MongoDB databases, models are represented by _collections_ and contain _docum } ``` -Prisma Client currently expects a consistent model and [normalized model design](https://www.mongodb.com/docs/manual/data-modeling/concepts/embedding-vs-references/#references). This means that: +Prisma Client currently expects a consistent model and [normalized model design](https://www.mongodb.com/docs/manual/data-modeling/best-practices/#std-label-data-modeling-best-practices). This means that: - If a model or field is not present in the Prisma schema, it is ignored - If a field is mandatory but not present in the MongoDB dataset, you will get an error diff --git a/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx b/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx index 6206bfe158..3039748c6c 100644 --- a/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx +++ b/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx @@ -37,9 +37,16 @@ export default defineConfig({ Database seeding happens when you run `prisma db seed`. With `prisma db seed`, _you_ decide when to invoke the seed command. It can be useful for a test setup or to prepare a new development environment, for example. +:::info[Prisma ORM v7 changes] -### Prisma 6 Only -Prisma Migrate also integrates seamlessly with your seeds, assuming you follow the steps in the section below. Seeding is triggered automatically when Prisma Migrate resets the development database. +In Prisma ORM v7, seeding is **only triggered explicitly** by running `npx prisma db seed`. Automatic seeding during `prisma migrate dev` or `prisma migrate reset` has been removed. + +::: + +
+Prisma ORM v6 and earlier + +In Prisma ORM v6 and earlier, Prisma Migrate also integrates seamlessly with your seeds. Seeding is triggered automatically when Prisma Migrate resets the development database. Prisma Migrate resets the database and triggers seeding in the following scenarios: @@ -49,6 +56,8 @@ Prisma Migrate resets the database and triggers seeding in the following scenari When you want to use `prisma migrate dev` or `prisma migrate reset` without seeding, you can pass the `--skip-seed` flag. +
+ ## Example seed scripts Here we suggest some specific seed scripts for different situations. You are free to customize these in any way, but can also use them as presented here: diff --git a/content/200-orm/500-reference/325-prisma-config-reference.mdx b/content/200-orm/500-reference/325-prisma-config-reference.mdx index 44a4048bdc..89f86821c5 100644 --- a/content/200-orm/500-reference/325-prisma-config-reference.mdx +++ b/content/200-orm/500-reference/325-prisma-config-reference.mdx @@ -176,7 +176,13 @@ The path to the directory where Prisma should store migration files, and look fo ### `migrations.seed` -This option allows you to define a script that Prisma runs to seed your database after running migrations or using the npx prisma db seed command. The string should be a command that can be executed in your terminal, such as with `node`, `ts-node`, or `tsx`. +This option allows you to define a script that Prisma runs when you execute the `npx prisma db seed` command. The string should be a command that can be executed in your terminal, such as with `node`, `ts-node`, or `tsx`. + +:::info[Prisma ORM v7 changes] + +In Prisma ORM v7, seeding is only triggered explicitly via `npx prisma db seed`. In Prisma ORM v6 and earlier, the seed script also ran automatically after `prisma migrate dev` and `prisma migrate reset`. + +::: | Property | Type | Required | Default | | ----------------- | -------- | -------- | ------- | diff --git a/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx b/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx index 7f314b1753..1b57828cb2 100644 --- a/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx +++ b/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx @@ -337,6 +337,16 @@ const prisma = new PrismaClient().$extends({ }) ``` +### Automatic seeding during migrations has been removed + +In Prisma ORM v6 and earlier, running `prisma migrate dev` or `prisma migrate reset` would automatically execute your seed script after applying migrations. This automatic seeding behavior has been removed in Prisma ORM v7. + +To seed your database in v7, you must explicitly run: + +```terminal +npx prisma db seed +``` + ### Various environment variables have been removed We've removed a small selection of Prisma-specific environment variables.