MasterWolfx
MasterWolfx
BABetter Auth
Created by MasterWolfx on 3/20/2025 in #help
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",
},
},
})
3 replies