Comments (8)
I just hit this issue tonight and Google'd my way here.
model User {
id String @id @default(cuid())
mother User?
father User?
children User[]
}
I expected this to just work. Naively maybe :)
I can make the error go away by:
model User {
id String @id @default(cuid())
mother User? @relation("mother")
father User?
children User[] @relation("mother")
}
or
model User {
id String @id @default(cuid())
mother User?
father User? @relation("father")
children User[] @relation("father")
}
But this doesn't make sense to me.
from prisma-engines.
Hey @yovanoc ,
thanks for reaching out! 🙏 Can you please answer the following questions:
- What's your full Datamodel?
- What version of the VS Code Plugin are you using?
from prisma-engines.
No problem @mavilein !
Here's the datamodel: https://gist.github.com/yovanoc/ca47e5fb738bfeb52cb37ef2cb07b1c3
And I don't know how to see the plugin version but It's surely the latest, even if I remove and install again. But I want to say thats not only in vscode:
from prisma-engines.
PS: It only appear when I uncomment the two last self references
from prisma-engines.
Ah thanks for the file. So the problem is that it is reported at the wrong location. You have to write your datamodel like this to fix that:
model CelestisInstance {
id CUID
...
boundDaemonInstance CelestisInstance? @relation(name: "MyRelation")
boundTerminalInstances CelestisInstance[] @relation(name: "MyRelation")
}
You need to specify this like that because we need to know if those fields belong to the same relation or two different relations. I will make myself a note to make this clearer with a suggestion.
from prisma-engines.
Oh that was my fault, so the "MyRelation" mean that is a self model relation??
from prisma-engines.
(This spawned an issue by @schickling in specs
: prisma/specs#213)
from prisma-engines.
Talked about this in triage today, this should be fixed.
from prisma-engines.
Related Issues (20)
- [DA] Planetscale engine tests: order and pagination HOT 1
- [DA] Planetscale engine tests: oids HOT 1
- [DA] Planetscale engine tests: prisma_17103::regression HOT 1
- [DA] Planetscale engine tests: nested_createmany_fail_dups HOT 1
- [DA] Planetscale engine tests: one2m_mix_required_writable_readable HOT 2
- [DA] Planetscale engine tests: gracefully_fails_when_uniq_violation HOT 1
- [DA] Planetscale engine tests: create_many_error_dups HOT 1
- [DA] Planetscale engine tests: apply_number_ops HOT 1
- [DA] Planetscale engine tests: upsert_fails_if_filter_dont_match HOT 1
- psl: Can not get documentation from model when these is a empty line. HOT 5
- Using `createMany` with SQLite in tests results in a panic with JSON protocol HOT 4
- `expected value at line 1 column 1` on overriden datasources with some connection strings HOT 4
- GraphQL playground equivalent for JSON protocol
- Why use exclusive locking mode in SQLite? HOT 7
- Binary engine: `--enable-playground` should imply `--engine-protocol graphql`
- Publish crates to crates.io HOT 13
- Avoid intermediary reads when doing nested updates
- How to start prisma engine
- Unify `native` and `all` features naming
- can we support batch updateManyX interface?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-engines.