Planetscale - New field with default(uuid) erroring out?

model Server {
***
apikey           String        @unique @default(uuid())
***
}

This is a new addition to my database, I can't seem to sync my planetscale database with this as it errors out, I also tried with @unique removed and with cuid().

Field 'apikey' doesn't have a default value (errno 1364) (sqlstate HY000) during query: insert into Server

Googling error with 'planetscale' doesn't help. Thier help support has nothing either.. HELP!
Solution
FIXED!

Terrifying though, unsure if correct.

I updated the database to have the apikey field. String?.

Then added back the schema to my
dev
branch in preperation.

Manually connected to my
main
db, updated existing values with raw SQL
UPDATE Server
SET apikey = UUID()
WHERE apikey IS NULL;


Then synced the
dev
branch. Fixed.
Was this page helpful?