openaienmodel: gpt-5-mini-2025-08-07
D1 migrations support nested layouts via migrations_pattern
Key Points
- Nested migration layouts supported
- migrations_pattern is a glob
- Defaults to ${migrations_dir}/*.sql
Summary
You can now configure Wrangler to discover D1 migration files in nested directory layouts (for example layouts produced by Drizzle) using the new migrations_pattern field in your D1 binding. wrangler d1 migrations apply will use this glob (relative to your Wrangler config) to find and apply migrations.
Key Points
- Configure the D1 binding with
migrations_pattern(a glob) to match nested files, e.g. set"migrations_pattern": "migrations/*/migration.sql"in your binding. - The pattern is evaluated relative to the Wrangler config file. The default remains
${migrations_dir}/*.sql, so existing projects are unaffected. - Each migration name recorded in the D1
migrationstable is stored as the path relative tomigrations_dir. - Typical workflow: update your D1 binding in
wrangler.toml/wrangler.json, then runwrangler d1 migrations applyas usual.
For implementation details and examples, see the D1 migrations documentation.