drizzle-team/drizzle-orm · error · Error

Missing migration: ${journalEntry.tag}

Error message

Missing migration: ${journalEntry.tag}

What it means

Error "Missing migration: ${journalEntry.tag}" thrown in drizzle-team/drizzle-orm.

Source

Thrown at drizzle-orm/src/expo-sqlite/migrator.ts:19

import { useEffect, useReducer } from 'react';
import type { MigrationMeta } from '~/migrator.ts';
import type { ExpoSQLiteDatabase } from './driver.ts';

interface MigrationConfig {
	journal: {
		entries: { idx: number; when: number; tag: string; breakpoints: boolean }[];
	};
	migrations: Record<string, string>;
}

async function readMigrationFiles({ journal, migrations }: MigrationConfig): Promise<MigrationMeta[]> {
	const migrationQueries: MigrationMeta[] = [];

	for await (const journalEntry of journal.entries) {
		const query = migrations[`m${journalEntry.idx.toString().padStart(4, '0')}`];

		if (!query) {
			throw new Error(`Missing migration: ${journalEntry.tag}`);
		}

		try {
			const result = query.split('--> statement-breakpoint').map((it) => {
				return it;
			});

			migrationQueries.push({
				sql: result,
				bps: journalEntry.breakpoints,
				folderMillis: journalEntry.when,
				hash: '',
			});
		} catch {
			throw new Error(`Failed to parse migration: ${journalEntry.tag}`);
		}
	}

View on GitHub (pinned to b7862528fd)

Solutions

  1. Copy the missing migration .sql file (and matching _journal.json entry) into the migrations folder bundled with the app, then re-run migrations.
  2. Regenerate migrations with drizzle-kit generate so the journal and SQL files are consistent.

When it happens

Trigger: Running expo-sqlite migrations when the bundle lacks the migration file listed in meta/_journal.json (asset not bundled or journal out of sync).

Common situations: Migrations folder not included in the Expo app bundle; journal edited manually; generate run after partial cleanup.


AI-assisted analysis of drizzle-team/drizzle-orm@b7862528fd (2026-08-03). Data as JSON: /data/errors/c5b769ed44832b5d.json. Report an issue: GitHub.