drizzle-team / drizzle-team/drizzle-orm
[BUG]: Default values for BigInt column causes do not know how to serialize a bigint when generating migration
- 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.31.2
### What version of `drizzle-kit` are you using?
0.22.6
### Other packages
_No response_
### Describe the Bug
### **When generating migration -**
If I add default value for BigInt column it causes this error:
TypeError: Do not know how to serialize a bigint
So if we add column like this:
```ts
column: bigint("column", {
mode: "bigint",
})
.notNull()
.default(0n);
```
that will then produce that error
But if we do it like this:
```ts
column: bigint("column", {
mode: "bigint",
})
.notNull()
.default(0 as unknown as bigint);
```
then it will work.
So it's not able to create proper json file from schema which prevents it to create SQL file.
Contributor guide
Assessment
This issue has not been assessed yet.