Drizzle Postgres UUID

How can I force better-auth to use uuid's for id's and rely on the database to generate them with the drizzle adapter. The below doesn't seem to work.
advanced: {
database: {
generateId: false,
},
}
advanced: {
database: {
generateId: false,
},
}
This PR merged seems it got rid of the behavior? https://github.com/better-auth/better-auth/pull/2248
3 Replies
Ping
Ping5d ago
Previously in an older PR, I changed schema generation to use uuid over text. However this was a major breaking change for all users who previously used our schema generation - a mistake on my end. If they had an existing schema which used ids as text (which has been what we've always been using until my breaking PR) then using schema generation after my breaking-pr would cause all id fields to convert to uuid. Because of this, their schema's can't be pushed since text can't convert to uuid. Right now, there isn't a way for you to tell the schema generation to use uuid for id fields. You will have to manually replace each id field to use uuid.
Connor
ConnorOP5d ago
Thank you for the info! One more question, the better-auth schema is overwriting my drizzle schema everytime and reverting any changes I make too it. Is that expected or is it supposed to merge in changes?
Ping
Ping5d ago
It prompts you if you want to overwrite. There isn't merging functionality as of now.

Did you find this page helpful?