Change User table primary key name

Hi everyone, is it possible to change user table primary key? This is what i've dont but it doesnt seem to work for primary key field:
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "mysql",
}),
emailAndPassword: {
enabled: true
},
socialProviders: {
google: {
clientId: process.env.OAUTH_GOOGLE_ID,
clientSecret: process.env.OAUTH_GOOGLE_SECRET,
}
},
user: {
modelName: "users",
fields: {
id: "user_pid",
email: "email",
name: "username",
emailVerified: "emailVerified",
image: "image",
},
},
})
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "mysql",
}),
emailAndPassword: {
enabled: true
},
socialProviders: {
google: {
clientId: process.env.OAUTH_GOOGLE_ID,
clientSecret: process.env.OAUTH_GOOGLE_SECRET,
}
},
user: {
modelName: "users",
fields: {
id: "user_pid",
email: "email",
name: "username",
emailVerified: "emailVerified",
image: "image",
},
},
})
1 Reply
bekacru
bekacru4w ago
It's not possible. If there is no issue on github, feel free to open one

Did you find this page helpful?