Panic: Did not find a relation for model
See original GitHub issueI’m using prisma 2.13.1
.
model Movie {
id String @id @default(cuid())
title String
slug String @unique
synopsis String
year Int
runtime Int
imdb String @unique
rating Float
poster String
genres String[]
cast ActorsOnMovies[] @relation("ActorsOnMovies")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Actor {
id String @id @default(cuid())
imdb String @unique
name String
movies ActorsOnMovies[] @relation("ActorsOnMovies")
createdAt DateTime @default(now())
updtedAt DateTime @updatedAt
}
model ActorsOnMovies {
actorId String
actor Actor @relation("ActorsOnMovies", fields: [actorId], references: [id])
movieId String
movie Movie @relation("ActorsOnMovies", fields: [movieId], references: [id])
character String
@@id([actorId, movieId])
}
Then I run prisma db push --force --preview-feature
and I get:
Running generate... (Use --skip-generate to skip the generators)
Error: Schema parsing
thread 'main' panicked at 'Did not find a relation for model Actor and field movies', libs/prisma-models/src/datamodel_converter.rs:80:29
stack backtrace:
0: _rust_begin_unwind
1: std::panicking::begin_panic_fmt
2: prisma_models::datamodel_converter::DatamodelConverter::convert_fields::{{closure}}::{{closure}}
3: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
4: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
5: prisma_models::datamodel_converter::DatamodelConverter::convert
6: query_engine::main::main::{{closure}}::main::{{closure}}
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
8: std::thread::local::LocalKey<T>::with
9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
10: async_io::driver::block_on
11: tokio::runtime::context::enter
12: tokio::runtime::handle::Handle::enter
13: std::thread::local::LocalKey<T>::with
14: std::thread::local::LocalKey<T>::with
15: async_std::task::builder::Builder::blocking
16: query_engine::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Panic following trauma: the etiology of acute posttraumatic ...
Posttraumatic panic was modestly predicted by childhood sexual abuse (CSA) experiences, a history of Anxiety and Depression, and peritraumatic dissociation.
Read more >Query with N to M Panics - Stack Overflow
I have two model in prisma one to many relation but i want to insert data into second model how to do this?...
Read more >Marriage in a panic: Panic disorder and intimate relationships
Panic disorder and agoraphobia often have a negative influence on the relationship and the non-affected partner. Partnership problems can be ...
Read more >Intimate partner violence (battered woman syndrome)
People who find themselves in an abusive relationship often do not feel ... have intense feelings of fear; have panic attacks or flashbacks...
Read more >Agoraphobia in adults: Incidence and longitudinal relationship ...
This finding was not surprising. However, the finding that baseline agoraphobia without spontaneous panic attacks also predicted first-onset panic disorder ...
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 FreeTop 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
Top GitHub Comments
I split this into a new issue @schwarzsky: https://github.com/prisma/prisma/issues/13193
Throws an error,