Investigate Prisma migrate drift before resetting a database
Database drift means the database schema no longer matches its migration history. Investigate a reset prompt before discarding any data.
npm install --save-dev @sitecmd/cli
npx sitecmd audit .
The CLI runs on your computer or in your CI, and your code stays there.
Drift checks run only with --inspect-local-databases. The CLI then reads the schema of a SQLite file in your project or a PostgreSQL database on your computer, without changing it, and flags Prisma or Drizzle migration history that's missing or behind your migration files.
Your code passes? Now watch your site.
Why is my database schema not in sync with migration history?
Check for schema changes made outside migrations and applied migrations that were edited or removed. Prisma's v7 troubleshooting guide explains drift and migration-history conflicts.
Choose Prisma migrate dev or deploy for the right environment
In Prisma ORM v7,
migrate devcreates and applies development migrations and may ask for a reset.migrate deployapplies pending migrations in production and testing environments. It doesn't detect schema drift. Don't run a development reset against production data.That's how the Prisma ORM v7 workflow uses these commands. Check the docs for your project's version.
Keep Drizzle migration files with the code that needs them
Choose the Drizzle workflow you mean to use. Generating SQL migrations and applying them are separate steps; pushing the schema directly is another workflow. Keep the history your deployment uses in version control. Drizzle's migration guide shows the options.
Frequently asked questions
Is it safe to run prisma migrate reset?
Prisma says migrate reset drops the database or schema where it can.
Review database lookups and raw queries after migration changes
Website reliability
Hear about it when your site goes down, not days later from a customer.
Postgres foreign key indexes
Index the foreign key columns your lookups and joins depend on.
SQL injection with an ORM
Keep request values out of the raw SQL your ORM runs.