drizzle-team / drizzle-team/drizzle-orm

[BUG]: drizzle-kit push making multiple `DROP CONSTRAINT NOT NULL`'s - PostgreSQL

Open
#5,156 12 comments 2 reactions 0 assignees View on GitHub
bug bug/fixed-in-beta db/postgres drizzle/kit
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [x] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.44.6

### What version of `drizzle-kit` are you using?

^0.31.5

### Other packages

_No response_

### Describe the Bug

- Database engine: PostgreSQL
- Current setting: backend API server with Nodejs runtime.
- `drizzle-kit push` generated multiple DROP CONSTRAINT NOT NULL on columns even though I made no update to those columns (in all tables). I traced this back to when this occurred and here are some information I recalled;
1. I was working on multiple databases, so as to test between my dev database and my prod one. At first, any update I made to the database, `drizzle-kit push` seemed to work normally as to update those part that I have made changes to.
2. Back to my most recent database, which was stored in a PostgreSQL docker instance on an Azure VM's Linux Ubuntu 24.04, it happened when I was trying to update some pgEnumType data for categorizations on my database, drizzle-kit decided to add multiple drop constraints that seemed to span all the database's tables.

Was there supposed to be something I have to do before getting to push that updates to my database. I really hope you guys can figure out what was wrong with it.

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.