Halvor
08/14/2021, 9:20 AMLike prisma.statGamemodeDM.aggregate() vs prisma.statGamemodeTDM.aggregate({
Jitesh Dhamaniya
08/14/2021, 10:36 AMJitesh Dhamaniya
08/14/2021, 10:38 AMkhareta
08/14/2021, 12:21 PMFlor Ronsmans De Vry
08/14/2021, 1:39 PMWARN
Invalid `prisma.licenseType.create()` invocation:
Null constraint violation on the fields: ()
Invalid `prisma.licenseType.create()` invocation:
Null constraint violation on the fields: ()
Rykuno
08/14/2021, 11:47 PMRykuno
08/15/2021, 12:04 AMHalvor
08/15/2021, 11:35 AMstephan levi
08/15/2021, 1:23 PMOmar Ghanim
08/16/2021, 4:21 AMuser
08/16/2021, 10:23 AMdanielvanc
08/16/2021, 10:33 AMper
08/16/2021, 10:38 AMSlackbot
08/16/2021, 10:49 AMBård
08/16/2021, 11:24 AMmodel Task {
id String @id @default(cuid())
title String
description String
location Location?
quiz Quiz[]
tasks Tasks?
}
model Tasks {
id Int @id @default(autoincrement())
sequence Int
lat Float?
lng Float?
distance Float?
quiz Int?
seedID String
taskID String
task Task @relation(fields: [taskID], references: [id])
seed Seed @relation(fields: [seedID], references: [id])
}
Unique constraint failed on the fields: ()taskID
kkangsan
08/16/2021, 12:22 PMid
) ERROR T^T...
Do you know how to reset pk?..
await prisma.user.deleteMany()
console.log(await prisma.user.findMany()); // []
await prisma.user.create({
data: {
id: '123',
},
}); // Error
Dan Shapir
08/16/2021, 12:31 PMGelo
08/16/2021, 2:32 PMGelo
08/16/2021, 2:42 PMVladi Stevanovic
kkangsan
08/17/2021, 1:37 AMkkangsan
08/17/2021, 1:38 AMVenu
08/17/2021, 4:53 AMDev__
08/17/2021, 9:31 AMprisma
do a toFixed
underwater when inserting a value to a Decimal
field type?Bård
08/17/2021, 10:09 AMmodel Seed {
id String @id @default(cuid())
uid String
score Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [uid], references: [id])
tasks Tasks[]
}
I want to query to create a highscore list based on the score value. But I also want to find the users relation to that highscore. Say that the users score is number 400 in the highscore list. Is there any way to query the model and sort by score, then count the amount of entries up to the first entry that contains the user?Dean Valentine
08/17/2021, 10:44 AMfunction resolveSession(cookies: Cookies, select: Prisma.SessionSelect) {
const session = await prisma.findUnique(where {...}, select: merge(select, {id: xxx, token: yyy, ...}),
...verify session integrity
return session
}
Dean Valentine
08/17/2021, 10:46 AMDean Valentine
08/17/2021, 10:49 AMstephan levi
08/17/2021, 12:41 PMTom
08/17/2021, 1:31 PMcy.exec(‘npm run db:reset’)
which runs this script:
echo “DROP DATABASE foodplanet WITH (FORCE); CREATE DATABASE foodplanet;” | sudo docker exec -i foodplanet psql -U postgres
cat prisma/backup/development_data.sql | sudo docker exec -i foodplanet psql -U postgres foodplanet
However, sometimes I get the error:
PrismaClientKnownRequestError3 [PrismaClientKnownRequestError]:
Invalid `prisma.nutrient.findMany()` invocation:
Server has closed the connection.
I think it is because the webapp is doing an API request in the same moment as the reset command gets executed. Does anybody know how to stop all current requests or the whole webapp during the execution of the command? The problem is that the cypress test fails because of the 500 server error.
Is there another way to reset the whole database between test suits? (I don’t want to use prisma seed because it is too slow)