Logesh
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
actually I have a table with name Account and I have built applicaiton based on that table, I thought of giving better-auth a try and I coudnt just rename my Account table . so I created another table as required by better-auth . and I couldnt able to point better-auth to use that table as account. Eventhough it was mentioned in docs
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
so you are saying we shouldnt disturb better-auth tables and work with other tables for applicaiton logic right ?
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
actually this prisma.account.create() is wrong model and it needs to be prisma.authAccount.create() that is the problem here
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
didnt work , still stuck with the same error
prisma:error
Invalid
prisma.account.create()
invocation:
{
data: {
accountId: "61owOGjhuhqTBQWY79bC51kr9ksQiANd",
providerId: "credential",
userId: "61owOGjhuhqTBQWY79bC51kr9ksQiANd",
password: "84f7e8ce004b0dd3aafe6ee981346a02:1b12c8cbe040aaf3997212ceb4116280a2f84413c0c0d142c93713e4f0b2a823a4a6e473571d31731dc19c7592b03ab48daf7a6bd497d716915f9958715f3ef8",
createdAt: new Date("2025-04-23T23:23:39.386Z"),
updatedAt: new Date("2025-04-23T23:23:39.386Z"),
id: "maorm6FwqdEkngBK7JDDmKfwg4c4ArUc",
+ name: String
},
select: undefined
}
Argument name
is missing.37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
let me try as you said
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
no I used npx prisma generate
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
yes I tried from this
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
model Account {
id String @id @default(cuid())
userId String
name String
type String
balance Float
currency String @default("USD")
isDefault Boolean @default(false)
creditLimit Float?
dueDate DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
accountNumber String?
institution String?
notes String?
isActive Boolean @default(true)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
transactions Transaction[] @relation("FromAccount")
transfers Transaction[] @relation("ToAccount")
recurringPayments RecurringPayment[]
@@index([userId])
}
this is the account but for this is not for better-auth , I need better-auth to use this model
model AuthAccount {
id String @id @default(cuid())
userId String
accountId String
providerId String
password String?
accessToken String?
refreshToken String?
idToken String?
accessTokenExpiresAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("auth_accounts")
}
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
is this okay or do you need something else ?
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
const { data, error: signUpError } = await signUp.email(
{
email,
password,
name,
callbackURL: "/dashboard",
},
{
onError: (ctx) => {
console.error("Error :", ctx.error);
alert(ctx.error.message);
},
}
);
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
using signup from better-auth.
37 replies
BABetter Auth
•Created by Logesh on 4/23/2025 in #help
Need help in adding Custom Table Names
✓ Compiled /api/auth/[...all] in 709ms (440 modules)
prisma:query SELECT "public"."User"."id", "public"."User"."name", "public"."User"."email", "public"."User"."createdAt", "public"."User"."updatedAt", "public"."User"."emailVerified", "public"."User"."image" FROM "public"."User" WHERE "public"."User"."email" = $1 LIMIT $2 OFFSET $3
prisma:query INSERT INTO "public"."User" ("id","name","email","createdAt","updatedAt","emailVerified") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "public"."User"."id", "public"."User"."name", "public"."User"."email", "public"."User"."createdAt", "public"."User"."updatedAt", "public"."User"."emailVerified", "public"."User"."image"
prisma:error
Invalid
prisma.account.create()
invocation:
{
data: {
accountId: "3BAfEkg1jx9QJtiVGSlYhjzJAm5chngO",
providerId: "credential",
userId: "3BAfEkg1jx9QJtiVGSlYhjzJAm5chngO",
password: "ebd6311b018ef66baac1750c0a4dce1a:a5feb3c830e8b5c2911fad5395c050255b9ed10797f72bd85b47a54ab4f703e35d951dbc580e1930eae709f2d49bd54979a1caaabe6595c68f72986385fd4859",
createdAt: new Date("2025-04-23T22:18:05.596Z"),
updatedAt: new Date("2025-04-23T22:18:05.596Z"),
id: "TlCQJEOM7ZeacFhFwY9s52FE2gXxCPFi",
+ name: String
},
select: undefined
}
Argument name
is missing.
SERVER_ERROR: PrismaClientValidationError:
Invalid prisma.account.create()
invocation:
{
data: {
accountId: "3BAfEkg1jx9QJtiVGSlYhjzJAm5chngO",
providerId: "credential",
userId: "3BAfEkg1jx9QJtiVGSlYhjzJAm5chngO",
password: "ebd6311b018ef66baac1750c0a4dce1a:a5feb3c830e8b5c2911fad5395c050255b9ed10797f72bd85b47a54ab4f703e35d951dbc580e1930eae709f2d49bd54979a1caaabe6595c68f72986385fd4859",
createdAt: new Date("2025-04-23T22:18:05.596Z"),
updatedAt: new Date("2025-04-23T22:18:05.596Z"),
id: "TlCQJEOM7ZeacFhFwY9s52FE2gXxCPFi",
+ name: String
},
select: undefined
}
Argument name
is missing.
this is the error I got as it is creating in the account model but not in the AuthAccount model.37 replies