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

Can't add typing to an Array JsonB column #2033

Open
mehamednews opened this issue Mar 8, 2025 · 0 comments
Open

Can't add typing to an Array JsonB column #2033

mehamednews opened this issue Mar 8, 2025 · 0 comments

Comments

@mehamednews
Copy link

Description and expected behavior

I'm trying to add typings to a JsonB array column:

model Cost {
  distribution Json[] @db.JsonB
}

I tried

model Cost {
  distribution Distribution[] @json
}

type Distribution {
  amount Float?
  rate   Float?
}

but then the generated prisma schema has:

model Cost {
  distribution Json
}

I'm expecting:

model Cost {
  distribution Json[] @db.JsonB
}

basically there are 2 problems (or maybe missing features):

  • I can't set @db.JsonB
  • I can't set the type as Json[]

any help would be appreciated 👍

Environment:

  • ZenStack version: 2.12.2
  • Prisma version: 6.4.1
  • Database type: Postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant