drizzle-team / drizzle-team/drizzle-orm

[BUG]:drizzle-kit generate: migration.sql is missing renamed column's changes

Open
#3,826 6 comments 2 reactions 0 assignees View on GitHub
bug bug/fixed-in-beta drizzle/kit priority
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.38.2

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

0.30.1

### Other packages

_No response_

### Describe the Bug

### What is the undesired behavior?
In schema file, when a column's name is changed and it's config is also changed like data type, not null constraint etc.; running drizzle-kit generate and selecting renamed column option only includes rename column sql command in generated migration file. sql commands for data type changes and adding/removing constraints are not included. generated snapshot correctly reflects new schema though. I am using 'postgresql' dialect.

### What are the steps to reproduce it?
- in schema file; change column name and change something in it's value like data type or add/remove not null constraint.
- Run drizzle-kit generate; select renamed column option.
- check generated sql migration file; it only includes rename column command and not other changes for the column.

### What is the desired result?
migration file should include sql commands for column data type and constraint changes along with rename command.

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.