Skip to content
Helm is almost here — the modular platform for enterprise excellence.Learn more →
Knowledge Base

Engineering

Prisma 7 migrations in practice

The one rule that keeps schema changes safe: add before you remove.

NA
Naventric Admin·July 22, 2026· 1 min read

Migrations that preserve data

A migration is only safe if it never drops information the app still needs. The rule we follow: add before you remove.

  • Add the new column as nullable, backfill it, then enforce NOT NULL in a later migration.
  • Rename by adding the new name, copying values, and deprecating the old one — not with a destructive rename.

Generating one

npm run db:migrate   # prisma migrate dev — creates + applies the migration

In CI the order is fixed: prisma generateprisma migrate deploy → seed. Skip generate and the client is stale, so the seed fails to import.