Skip to content

fix(expo-sqlite): make journal optional in useMigrations migration config - #5428

Open
sleitor wants to merge 1 commit into
drizzle-team:betafrom
sleitor:fix-5214
Open

fix(expo-sqlite): make journal optional in useMigrations migration config#5428
sleitor wants to merge 1 commit into
drizzle-team:betafrom
sleitor:fix-5214

Conversation

@sleitor

@sleitor sleitor commented Mar 4, 2026

Copy link
Copy Markdown

Fixes #5214

Problem

useMigrations() requires a journal property in the second argument, but the journal field is never read — the function just passes the object as migrations as any to migrate(). Users generating migrations with the new V1 format don't have a journal file and hit a TypeScript compile error:

Property 'journal' is missing in type '{ migrations: {...} }' but required in type '{ journal: ...; migrations: ... }'

Fix

Mark journal as optional (journal?) in the useMigrations parameter type. No runtime behaviour changes — the field was already unused.

@sleitor

sleitor commented Apr 7, 2026

Copy link
Copy Markdown
Author

👋 Gentle ping — just checking if this is still on the radar for review. Happy to address any feedback or rebase if needed!

@rvieceli

rvieceli commented Jul 2, 2026

Copy link
Copy Markdown

Hi @sleitor I think you can remove journal because it has been removed in v1, you can check here https://orm.drizzle.team/docs/upgrade-v1.

@sleitor

sleitor commented Jul 3, 2026

Copy link
Copy Markdown
Author

Thanks for the pointer @rvieceli!

Making journal optional (rather than removing it) is intentional for backward compatibility — users on the V0/V1 migration format that include journal in their migration objects will continue to type-check correctly, while V2 migration objects that omit journal will also be accepted.

If the drizzle team prefers to remove it outright (treating V0/V1 format as unsupported in useMigrations), I'm happy to update the PR — just need a signal from a maintainer. Either way the type error reported in #5214 is fixed.

In V2 migrations, the generated object no longer includes a `journal`
field. However, useMigrations() required it in its type signature even
though it was never used (passed as `migrations as any` to migrate()).

Making `journal` optional fixes the TypeScript error for users on V2
migrations without breaking existing code.

Fixes drizzle-team#5214
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.

2 participants