studio icon indicating copy to clipboard operation
studio copied to clipboard

[7.0.1] Prisma studio cannot update enum array anymore with Postgresql

Open RVBastien opened this issue 1 year ago • 2 comments

Bug description

Image

This issue arise when i try to update an array of enum.

Here the request made by studio :

update "public"."User" set "roles" = cast($1 as "public"."Role[]") where "id" = $2 returning "onBoarded", "lastName", "firstName", "picture", "name", "email", "lastConnectedAt", "createdById", "id", "roles", cast(floor(extract(epoch from now()) * $3) as text) as "__ps_updated_at__"

I think it could be solve by changing "public"."Role[]" to "public"."Role"[]

Severity

🚨 Critical: Data loss, app crash, security issue

Reproduction

Simply try to edit an array of enum

Expected vs. Actual Behavior

Should work as before and i should be able to modify my enum via studio

Frequency

Consistently reproducible

Does this occur in development or production?

Only in development (e.g., CLI tools, migrations, Prisma Studio)

Is this a regression?

Yes, it was working with previous to 7 version of prisma

Workaround

Prisma Schema & Queries

Here

Prisma Config

model User {
  id                   String                @id @default(uuid()) @db.Uuid
  roles                Role[]
}

enum Role {
  ADMIN
  MANAGE
  VISIT
}


Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version

// Prisma version output

RVBastien avatar Dec 01 '25 13:12 RVBastien

Hey @RVBastien, @do4gr I understand the issue and would be happy to help fix it. Could you please assign this issue to me?

White-D-coder avatar Dec 02 '25 10:12 White-D-coder

Thanks for the detailed description. This should now be fixed 🙏

sorenbs avatar Mar 24 '26 12:03 sorenbs