Default JSON Value

Hello, I am using T3 stack with prisma and planetscale. I am trying to add a new column to my database table that is of type JSON and defaulting it to and empty JSON array like the following which is what I found
newCol Json @default("[]")
newCol Json @default("[]")
In prisma this works fine, but when I psuh it to planetscale it doesn't recognize the default. I only see:
newCol json NOT NULL
newCol json NOT NULL
and I get a deployment error on planetscale because it couldn't pick up on the @default. From my research newer versions of MySQL should support setting a default JSON value
1 Reply
Connor B
Connor B11mo ago
This is a known issue with Vitess, try using the following as a work around: ("json_array()")
Want results from more Discord servers?
Add your server