drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.55k stars 643 forks source link

[BUG]: migration to type `serial` for postgres is wrong #2999

Closed Perdolique closed 3 weeks ago

Perdolique commented 1 month ago

What version of drizzle-orm are you using?

0.33.0

What version of drizzle-kit are you using?

0.24.2

Describe the Bug

I've changed column in schema from text to serial and got incorrect migration:

ALTER TABLE "woof" ALTER COLUMN "id" SET DATA TYPE serial;--> statement-breakpoint

But type serial doesn't exist in postgres.

Expected behavior

Migration was generated correctly, or some kind of notice was added that it's not possible.

Environment & setup

No response

L-Mario564 commented 3 weeks ago

Closing in favor of #2183.