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
21.38k stars 480 forks source link

[BUG]: Error setting default enum field values #2299

Open Malin88 opened 1 month ago

Malin88 commented 1 month ago

What version of drizzle-orm are you using?

0.29.5

What version of drizzle-kit are you using?

0.21.1

Describe the Bug

After update drizzle-kit to version 0.21.1 I cannot set default values for enum field.

export const userStatusEnum = pgEnum("status", ["inactive", "active", "banned"]);

createTable( "users", {
   status: userStatusEnum("status").default('inactive').notNull()
})

Returns error: invalid input value for enum status: "inactive". Before update everything works correctly

Expected behavior

Set the default status field value to "inactive".

Environment & setup

No response

Alshafei2430 commented 1 month ago

I have the same error.

DanielSintimbrean commented 1 month ago

Same here

hyqshr commented 1 week ago

same