drizzle-team / drizzle-team/drizzle-orm
`drizzle-kit migrate` hangs indefinitely with "applying migrations..." - never completes or errors
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
## Bug Description
`npx drizzle-kit migrate` hangs forever, showing "applying migrations..." spinner but never completes or throws an error.
## Environment
- drizzle-kit: 0.31.10
- drizzle-orm: 0.45.1
- Database: PostgreSQL (local)
- Node: 22.x
- OS: macOS
## Steps to Reproduce
1. Fresh database with `DROP SCHEMA public CASCADE; CREATE SCHEMA public;`
2. Extensions installed: vector, pg_trgm, pg_textsearch
3. Run `npx drizzle-kit migrate`
4. Command shows spinner "applying migrations..." and never returns
## Expected Behavior
Migrations should apply and command should exit, or show an error if something fails.
## Actual Behavior
Command hangs indefinitely. No output, no error. Must be killed manually.
## Additional Context
- Database connection works fine (tested with raw queries via drizzle-orm)
- `drizzle-kit generate` works
- `drizzle-kit push` works
- Only `migrate` hangs
- drizzle.config.ts is valid
## Workaround
Wrote a custom migration script that reads the journal and applies migrations manually with proper timeouts and error handling. Happy to share if useful.
Contributor guide
Research direction
Start by reproducing `npx drizzle-kit migrate` against the fresh local PostgreSQL setup described, using the existing `drizzle.config.ts`; compare its behavior with `generate` and `push`. Trace the `drizzle-kit migrate` entry point and migration application flow to identify why the spinner never resolves. Done means migrations apply or report an error, and the command exits without manual termination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, postgresql, typescript
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100