DevMeth
R11

AI code debt

Prisma Migration Drift Check — Do Your Models Have Migrations?

DevMeth checks the 48 known AI-code failure patternsnot a penetration test or a security guarantee.

What the issue is

A Prisma model with no migration file means the schema changed on one machine and nowhere else. The database works during development and drifts at the next checkout, the next staging deploy, and — worst — production.

Why AI tools generate it

An agent edits schema.prisma directly and lets a local `db push` create the table, never generating the migration the rest of the team relies on. The committed schema and the tracked migrations silently disagree.

How DevMeth detects it

The scan reads every model declared in schema.prisma, scans the migrations directory for CREATE TABLE statements, and reports each model with no matching table. Projects with no migrations directory are skipped, since `db push` leaves nothing to check.

R11
What a finding looks like
High

Prisma models have no migration — your schema and your database can quietly fall out of sync

WHAT WE FOUND

prisma/schema.prismamodel AuditLog has no CREATE TABLE migration

Sample — illustrative and masked exactly as a real report shows it. Run a free scan to see your own results.

The fix, in three steps

Generate a migration for each flagged model and commit it, or confirm the project genuinely runs `db push`. Never hand-edit migration files to paper over the gap.

Run a free scan and each finding carries a paste-ready fix prompt you can act on.

Maintainability findings ship in the Rescue Report — bundled with the Launch Pack or available on its own.

Try a free scan

FAQ

How does a local database still work without a migration?

A `db push` or an ad-hoc run creates the table on the local database directly, so the developer's machine looks healthy while every other environment applies only the committed migrations — and fails.

Is `db push` always a problem?

No. Some projects deliberately use `db push` and keep no migrations directory — the scan skips those because there is nothing to drift against. The finding is about projects that track migrations and then bypass them.

What about the reverse — a table with no model?

That direction is not reported here: proving a table is orphaned is beyond what a static scan can hold, so the finding stays limited to the side that is proven from the schema and migrations alone.

DevMeth checks the 48 known AI-code failure patternsnot a penetration test or a security guarantee. A clear result means each known pattern was checked and found clear or not applicable for your app; it is not a guarantee of security.