drizzle-team / drizzle-team/drizzle-orm

[BUG]: push doesn't allow to add "not null" to the column without truncating the table

Open
#3,385 4 comments 3 reactions 0 assignees View on GitHub
drizzle/kit improvement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

If you have a nullable column in a table and add `.notNull()` to it, `drizzle-kit push` won't allow you to apply this change without truncating the table, even though technically it's possible to apply if that column doesn't contain null values.

Two potential solutions:
1. Check if the column contains null values before suggesting to truncate the table (the most correct)
2. Just remove the warning and run the operation regardless, which will either work or fail if the column has null values (less work)

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.