Optional accountId table?

Hey, first of all i love better-auth, good work guys. While going through the documentation, I came across the account table schema and noticed that the accountId (for OAuth) is marked as optional (LINK). I tried searching the GitHub repo with some Ctrl+F action, but unfortunately, I couldn’t find the answer I was looking for. Is it possible to skip creating the accountId field altogether for discord provider or i have to use generic oauth to manipulate the write?
User & Accounts | Better Auth
User and account management.
2 Replies
bekacru
bekacru2mo ago
why do you want to avoid creating the account Id? the account Id is the id returned from the provider.
segmentationfault
segmentationfaultOP2mo ago
I’m working on a large project where I already have accountId information stored in my database. To save space and avoid data duplication, I’m trying to merge two existing systems. For ad-hoc purposes, I could technically permit accountId creation and write it to the database, then later replace it with a link to the pre-existing account. However, this approach would still demand extra computational effort. @bekacru

Did you find this page helpful?