arsh.bakh
arsh.bakh
PPrisma
Created by arsh.bakh on 10/25/2024 in #help-and-questions
Error
I get a error on my data when i create a user and i saw some blogs where its cus i have information i have mandated to setup but I dont understand what it is since i basically made everything possibly optional. This is the error ype '{ email: string; balance: number; username: string; }' is not assignable to type '(Without<UserCreateInput, UserUncheckedCreateInput> & UserUncheckedCreateInput)
const user = await prisma.user.create({
data:{
balance : 0.00,
username : "arshbakh",
}
})


model Bet {
id Int @id @default(autoincrement())

placedDate DateTime? @default(now())
updateDate DateTime? @updatedAt
team1 String?
team2 String?
amount Float?
winningAmount Float?
status String?
odds Float?

//many bets to one user
user User? @relation(fields: [userId], references: [id])
userId Int?

//many bets to one agent
agent Agent? @relation(fields: [agentId], references: [id])
agentId Int?
}
const user = await prisma.user.create({
data:{
balance : 0.00,
username : "arshbakh",
}
})


model Bet {
id Int @id @default(autoincrement())

placedDate DateTime? @default(now())
updateDate DateTime? @updatedAt
team1 String?
team2 String?
amount Float?
winningAmount Float?
status String?
odds Float?

//many bets to one user
user User? @relation(fields: [userId], references: [id])
userId Int?

//many bets to one agent
agent Agent? @relation(fields: [agentId], references: [id])
agentId Int?
}
whats my issue?
3 replies
PPrisma
Created by arsh.bakh on 10/15/2024 in #help-and-questions
Beginner Help
Hey guys, this is my first time working with backend and databases and im have a bunch of trouble, so I am using Prisma obiovusly and postgresSQL, with that being said im stuck on the step where i add my database connection string, i looked into older prisma videos but the User experience has changed since those videos so it doesnt have the same setup, if someone can help me setup the database id appreciate it.
11 replies