Skip to content

prisma migrate dev: schema validation happens late in the process  #5321

@albertoperdomo

Description

@albertoperdomo

Problem

When caling prisma migrate dev, the schema validation happens to late in the process. If there is a migration history conflict or database drift, Prisma Migrate will ask to reset the development database.

After the database is reset, then Prisma Migrate will try to generate a new migration but fail with an error if the PSL is invalid.

How to reproduce

  1. Make sure database is in sync with Prisma schema using native type notation
  2. Disable the feature flag but keep the native types notation -> This makes the schema invalid
  3. Cause drift on the database
  4. Make some new changes to the Prisma schema
  5. Run prisma migrate dev

Solution

Always validate the schema first

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions