Error in SQL syntax when pushing schema
Hello, I'm trying to push my database schema to planetscale using
drizzle-kit push:mysql
, but I got the error below after confirming the execution. Can someone point out for me what did i do wrong?
this is my schema
and this is the SQL generated by drizzle-kit push:mysql
Thank youSolution:Jump to solution
i decided to not generate the uuid from the schema, remove the default value from the ID, and generate the ID when i'm calling the function. Thank you
3 Replies
I found that the error comes from the UUID(), can someone tell me how to generate a default UUID for my id? I tried using sql
UUID()
and sqlUUID_TO_BIN(UUID())
. Both gives a syntax error. is it because planetscale is using an older version of mysql? or the only way for me to do it is to generate the UUID when i'm calling the function i'll be writing after this? (like addCustomer)Solution
i decided to not generate the uuid from the schema, remove the default value from the ID, and generate the ID when i'm calling the function. Thank you
This is not possible in older version of mysql
And even now it has it's limitations/problems