Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Default values for BigInt column causes do not know how to serialize a bigint when generating migration #3609

Open
1 task done
tusharvaswani714 opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working drizzle/kit has-pr This issue has one or more PRs that that could close the issue when merged priority Will be worked on next

Comments

@tusharvaswani714
Copy link

Report hasn't been filed before.

  • 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:

column: bigint("column", {
  mode: "bigint",
})
  .notNull()
  .default(0n);

that will then produce that error

But if we do it like this:

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.

@tusharvaswani714 tusharvaswani714 added the bug Something isn't working label Nov 25, 2024
@L-Mario564 L-Mario564 added drizzle/kit priority Will be worked on next labels Nov 28, 2024
@L-Mario564 L-Mario564 self-assigned this Jan 30, 2025
@L-Mario564 L-Mario564 added the has-pr This issue has one or more PRs that that could close the issue when merged label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working drizzle/kit has-pr This issue has one or more PRs that that could close the issue when merged priority Will be worked on next
Projects
None yet
Development

No branches or pull requests

2 participants