postges, auto-generated uuid as primary key
I'm looking to change all my tables from having a serial int primary key as ID
what is the best way for generating the column definition in the drizzle schema file?
Thank you
9 Replies
i have it like this. my postgres has a uuid v7 extension installed so it generates
thank you, i'll try it out. I didn't know it would need an extension for it
do you know how i can install it in my AWS RDS posgres instance?
im using neon so i dont know. try asking chatgpt
i did
you like just need to execute a SQL command CREATE EXTENSION ...
ChatGPT tells me that, but it only mentions UUID v4, i don't know the differences
sql
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
sql
SELECT * FROM pg_extension WHERE extname = 'uuid-ossp';
v4 is fine to use
awesome, it's working
thank you so much
am using neon too, but how do i stop the type system from asking me to insert an id?