Skip to content

fix(drizzle-kit): handle missing snapshot in migrateToFoldersV3#5595

Open
danpeleg4 wants to merge 1 commit intodrizzle-team:betafrom
danpeleg4:beta
Open

fix(drizzle-kit): handle missing snapshot in migrateToFoldersV3#5595
danpeleg4 wants to merge 1 commit intodrizzle-team:betafrom
danpeleg4:beta

Conversation

@danpeleg4
Copy link
Copy Markdown

Problem

When running drizzle-kit migrate on older projects, migrateToFoldersV3 would crash with process.exit(1) if a snapshot file was missing for a migration entry.
This happens legitimately for migrations created before drizzle-kit started tracking snapshots (e.g. the very first migration in older projects).

Fixes #5591

Solution

Instead of treating a missing snapshot as a fatal error, the function now:

  • Emits a warning identifying the affected migration
  • Skips writing snapshot.json for that entry
  • Continues migrating the SQL file normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant