schema.prisma
without creating migrations, the update to the newer database schema can damage or delete all data in production mode, since the system sometimes doesn’t know how to transform the data from A to B. Using migrations, each step is reproducible, transparent and can be undone in a simple way.
schema.prisma
file, you must create a migration.
To create a migration for your previously changed schema.prisma
, simply run the following:
_prisma_migrations
to keep track of which migrations have been applied and which haven’t. If your local migrations database doesn’t match up with what’s in the actual database, then Prisma will throw the following error:
migration_name
with each migration that you have already applied: