gustav
09/20/2021, 6:09 PMChris Tsongas
09/20/2021, 7:15 PMprisma.schema
? The docs give a good comparison for how implicit m-n relations simplify queries, and of course if a relation table needs to store additional fields I would define it explicitly, but are implicit relations generally recommended?Chris Tsongas
09/20/2021, 7:25 PMON DELETE CASCADE ON UPDATE CASCADE
which seems strange given that relations now default to disallow? Maybe that's just to delete the relation if one of the related items gets deleted?Chris Packett
09/20/2021, 10:59 PMStep 0 Added the required column `companyId` to the `Subscription` table without a default value.
what’s the best way around this?Chris Packett
09/20/2021, 11:01 PMInt
?
Or is there something else I can do?Markey Boi
09/21/2021, 12:46 AMMarkey Boi
09/21/2021, 12:53 AMAnmol Jawandha
09/21/2021, 6:45 AMDamien Duhamel
09/21/2021, 7:56 AMuser
09/21/2021, 9:25 AMBård
09/21/2021, 10:00 AMconst result = await prisma.profile.findMany({
distinct: ['schoolKey', 'sex'],
where: {
user: {
emailVerified: {
not: null,
},
},
},
select: {
_count: {
sex: true
},
},
});
I'm getting the error:
Unknown field _count
for select statement on model Profile.Albin Groen
09/21/2021, 11:09 AMmodel Task {
id String @id @default(uuid())
completed Boolean @default(false)
title String
companyId String
}
In this case I would like to the companyId field to reference a company
model. The thing is though, companies doesn't live in the task database. Also, the
model doesn't live in this service either.
How would I go about solving this?Harsha MV
09/21/2021, 11:27 AMHarsha MV
09/21/2021, 11:27 AMHarsha MV
09/21/2021, 11:29 AMHarsha MV
09/21/2021, 11:29 AMmodel ProjectCategories {
project Project @relation(fields: [projectId], references: [id])
projectId String // relation scalar field (used in the `@relation` attribute above)
category Category @relation(fields: [categoryId], references: [id])
categoryId String // relation scalar field (used in the `@relation` attribute above)
@@id([projectId, categoryId])
}
Harsha MV
09/21/2021, 11:31 AMmodel Project {
id String @id @unique @default(uuid()) @db.Uuid
name String @db.VarChar(255)
catgories ProjectCategories[]
}
Harsha MV
09/21/2021, 11:32 AMmodel Category {
id String @id @unique @default(uuid()) @db.Uuid
name String @db.VarChar(255)
projects ProjectCategories[]
}
Salah eddine Ait Balkacem
09/21/2021, 12:19 PMHarsha MV
09/21/2021, 12:25 PMHarsha MV
09/21/2021, 12:25 PMcategories: {
create: [
{
category: {
connect: {
id: categoriesArr[randomCategory],
},
},
},
],
},
Harsha MV
09/21/2021, 12:26 PMHarsha MV
09/21/2021, 12:26 PMSalah eddine Ait Balkacem
09/21/2021, 12:28 PMDamien Duhamel
09/21/2021, 1:13 PMuser
09/21/2021, 3:32 PMMatt Langer
09/21/2021, 6:21 PMMo El
09/21/2021, 6:44 PMHarsha MV
09/21/2021, 7:03 PMprisma migrate reset
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42601"), message: "syntax error at or near \"yarn\"", detail: None, hint: None, position: Some(Original(1)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("scan.l"), line: Some(1176), routine: Some("scanner_yyerror") }
Harsha MV
09/21/2021, 7:03 PM