Prisma
Learn how to add a
seed.mts
to your project, using our quick start guide.
Prisma Migrations creates the database structure, Snaplet seed requires to generate data against.
If you don't want to run two commands, you can automatically seed the database with data, after running prisma migrate reset
or prisma migrate dev
, by adding the following to your package.json
file.
Learn "how to seed your database in Prisma" (opens in a new tab) from their documentation.
Note on Migrations
Whenever your database structure changes (e.g after a new migration is applied), @snaplet/seed
will need be regenerated to reflect the new structure. To do this, run the following command: