drizzle-team / drizzle-team/drizzle-orm

[BUG]: Implicit sequences are not tracked in migrations

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

Description

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

0.31.2

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

0.22.7

### Describe the Bug

Sequences created by using the `*serial` column types in postgres are not tracked by migrations.

I mistakenly created a reference column with type `bigserial` rather than `bigint`. After fixing the mistake and generating the migration that changed the column type, the underlying sequence was not deleted and the default on the column was still in place.

Similarly, renaming a column that has an implicit sequence attached will not rename the sequence.

### Expected behavior

I would expect the generated migration to also update the underlying sequences.

### Environment & setup

At least when targeting postgres for migrations.

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.