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]: Incorrect type for array column default value #2334

Closed
Ziothh opened this issue May 16, 2024 · 3 comments
Closed

[BUG]: Incorrect type for array column default value #2334

Ziothh opened this issue May 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Ziothh
Copy link

Ziothh commented May 16, 2024

What version of drizzle-orm are you using?

0.30.3

What version of drizzle-kit are you using?

0.20.17

Describe the Bug

When running drizzle-kit push:pgI get this error:

This happens when I have a integer().array().default([]) column.
The types allow for a JS array to be passed but it errors when I do.
I need to pass sql'ARRAY[]::integer[]' instead.

> drizzle-kit push:pg

drizzle-kit: v0.20.17
drizzle-orm: v0.30.3

No config path provided, using default path
Reading config file '/Users/zioth/funkey/monorepo/feature/I1034-Bizz-Activity_Selection/apps/api/drizzle.config.ts'
error: syntax error at or near "NOT"
    at /Users/zioth/funkey/monorepo/feature/I1034-Bizz-Activity_Selection/node_modules/drizzle-kit/bin.cjs:43518:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PgPostgres.query (/Users/zioth/funkey/monorepo/feature/I1034-Bizz-Activity_Selection/node_modules/drizzle-kit/bin.cjs:62584:21)
    at async Command.<anonymous> (/Users/zioth/funkey/monorepo/feature/I1034-Bizz-Activity_Selection/node_modules/drizzle-kit/bin.cjs:66267:9) {
  length: 94,
  severity: 'ERROR',
  code: '42601',
  detail: undefined,
  hint: undefined,
  position: '1214',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'scan.l',
  line: '1241',
  routine: 'scanner_yyerror'
}

Expected behavior

No response

Environment & setup

No response

@Ziothh Ziothh added the bug Something isn't working label May 16, 2024
@Ziothh Ziothh changed the title [BUG]: Can not use pg jsonb().array() for schema. [BUG]: Incorrect type for array column default value May 16, 2024
@panieldark
Copy link

Also experiencing this!

@AndriiSherman
Copy link
Member

Should be fixed in drizzle-kit0.24.0
Please check release notes before updating

@panieldark
Copy link

Love waking up to a fix! Thanks, you guys are killing it 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants