Report hasn't been filed before.
What version of drizzle-orm are you using?
beta-20
What version of drizzle-kit are you using?
beta-20
Other packages
No response
Describe the Bug
Describe the bug
When drizzle-kit migrate runs against PostgreSQL and a migration fails because of a SQL error (e.g. the database rejects a statement), the CLI process exits with non-zero (e.g. 1) but does not print the underlying error to stdout/stderr. The last thing you see is the animated “applying migrations…” spinner line, so it looks like a silent failure.
Expected behavior
On migration failure, the CLI should print the same error details users need to fix the migration or the database (at minimum: the message from the failed statement / driver error), similar to other commands that surface errors clearly.
Actual behavior
- Exit code is non-zero (failure is detectable in CI).
- No error message is shown; output stops on the spinner line.
How to reproduce
- Use
drizzle-kit with PostgreSQL (pg driver) and a normal drizzle.config.ts pointing at a database.
- Include a migration whose SQL fails when executed (any intentional SQL error is enough — e.g. a statement that the database rejects).
- Run
drizzle-kit migrate.
Observe: command fails with exit code 1 but no visible error text.
Note: Running the same migrations programmatically via drizzle-orm’s migrate() (e.g. drizzle-orm/node-postgres/migrator) does surface the error, which confirms the failure is real and only the CLI output path is wrong.
Environment
- OS: (any; observed on macOS)
drizzle-kit: (beta / version in use)
drizzle-orm: (beta / version in use)
- Driver:
pg / PostgreSQL
Possible cause (for maintainers)
In the bundled CLI, TaskTerminal.reject(err) calls view.render("rejected", err), but MigrateProgress.render appears to only accept status and treats "rejected" the same as "pending" (spinner only), without using the err argument. Other progress views (e.g. introspection) include a branch that prints error.message when status === "rejected".
If that’s accurate, the fix would be to extend MigrateProgress to render the error on rejection, consistent with those other views.
Additional context
This makes debugging failed migrations unnecessarily difficult in local and CI environments because users must bypass the CLI or add wrappers to see the real database error.
Report hasn't been filed before.
What version of
drizzle-ormare you using?beta-20
What version of
drizzle-kitare you using?beta-20
Other packages
No response
Describe the Bug
Describe the bug
When
drizzle-kit migrateruns against PostgreSQL and a migration fails because of a SQL error (e.g. the database rejects a statement), the CLI process exits with non-zero (e.g.1) but does not print the underlying error to stdout/stderr. The last thing you see is the animated “applying migrations…” spinner line, so it looks like a silent failure.Expected behavior
On migration failure, the CLI should print the same error details users need to fix the migration or the database (at minimum: the message from the failed statement / driver error), similar to other commands that surface errors clearly.
Actual behavior
How to reproduce
drizzle-kitwith PostgreSQL (pgdriver) and a normaldrizzle.config.tspointing at a database.drizzle-kit migrate.Observe: command fails with exit code
1but no visible error text.Note: Running the same migrations programmatically via
drizzle-orm’smigrate()(e.g.drizzle-orm/node-postgres/migrator) does surface the error, which confirms the failure is real and only the CLI output path is wrong.Environment
drizzle-kit: (beta / version in use)drizzle-orm: (beta / version in use)pg/ PostgreSQLPossible cause (for maintainers)
In the bundled CLI,
TaskTerminal.reject(err)callsview.render("rejected", err), butMigrateProgress.renderappears to only acceptstatusand treats"rejected"the same as"pending"(spinner only), without using theerrargument. Other progress views (e.g. introspection) include a branch that printserror.messagewhenstatus === "rejected".If that’s accurate, the fix would be to extend
MigrateProgressto render the error on rejection, consistent with those other views.Additional context
This makes debugging failed migrations unnecessarily difficult in local and CI environments because users must bypass the CLI or add wrappers to see the real database error.