No validation error on 1:m ambiguous relation
See original GitHub issueHi Prisma Team! My Prisma Client just crashed. This is the report:
Versions
Name | Version |
---|---|
Node | v10.20.1 |
OS | darwin |
Prisma | 2.5.1 |
Logs
prisma-client { engineConfig:
prisma-client { cwd: '/Users/user/project/prisma',
prisma-client enableDebugLogs: false,
prisma-client enableEngineDebugMode: undefined,
prisma-client datamodelPath:
prisma-client '/Users/project/node_modules/.prisma/client/schema.prisma',
prisma-client prismaPath: undefined,
prisma-client engineEndpoint: undefined,
prisma-client generator:
prisma-client { name: 'client',
prisma-client provider: 'prisma-client-js',
prisma-client output:
prisma-client '/Users/project/node_modules/@prisma/client',
prisma-client binaryTargets: [],
prisma-client previewFeatures: [],
prisma-client config: {} },
prisma-client showColors: false,
prisma-client logLevel: 'info',
prisma-client logQueries: true,
prisma-client flags: [],
prisma-client clientVersion: '2.5.1',
prisma-client enableExperimental: [],
prisma-client useUds: undefined } }
plusX Execution permissions of /Users/project/artemis/node_modules/.prisma/client/query-engine-darwin are fine
prisma-client Client Version 2.5.1 +29s
prisma-client Engine Version 9a670138b1db276001d785a2adcba1584c869d24
Prisma.schema
model AuthorBook {
authorId Int
booksId String
author Author @relation(fields: [authorId], references: [id])
books Book @relation(fields: [bookId], references: [id])
@@id([authorId, bookId])
@@map("author_book")
}
model Author {
id Int
name String
books Book[]
@@map("author")
}
model Book {
id Int
title String
description String
authors Author[]
@@map("book")
}
TS file
const books = await prisma.authorBook.findMany({
where: {
authorId: `${author.id}`,
},
include: {
book: true,
},
});
The above is an abstracted example of how I’m trying to call this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Prisma throwing error: Ambiguous relation detected
I'm using prisma and trying to model a referral table for my Postgres database. Not sure if the db ...
Read more >Column 'id' in field list is ambiguous select2 edit mode
Hi, i have a problem to take data from relationship belongstomany, i try take data when i edit post and i have this...
Read more >Ambiguous About Ambiguity?: How to help your team deal ...
7 Ways to Help Your Team Deal with Ambiguity "Accepting that the world is full of uncertainty and ambiguity does not and should...
Read more >I'm two weeks into no contact and my ex text a ... - Quora
Although it is a bit ambiguous, I would say no. If your ex had any kind of relationship with your daughter, she may...
Read more >Attitudes Toward and Perceptions of the Ambiguity of House ...
conference, MEA conference and AREUEA-ASSA conference, All errors are our own. ... Ambiguity describes the situations where the odds of each outcome are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like query engine doesn’t panic with the schema in latest version anymore.
But migrate now tries to add two foreign keys with above schema:
So moving this to the migrate team now.
This should be solved by us splitting the parsing and formatting step here https://github.com/prisma/prisma-engines/pull/1662