prisma: [Introspection] Panic: Unable to resolve scalar field / @@unique does not work with non-scalar fields
Introspection error message might look like:
Schema parsing
thread 'main' panicked at 'Unable to resolve scalar field 'A'', src/libcore/option.rs:1185:5
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
...
Example schema where it happens: https://github.com/prisma/database-schema-examples/blob/master/mysql/sakila/schema.sql
Introspection Analysis Pattern Description:
Panic: Model (probably) has a @@id or @@unique, that refers to a non-scalar field. This usually happens in table inheritance and join tables without IDs.
More details in the internal introspection analysis repository, look for the known pattern: panic-unable-to-resolve-scalar-field
This problem can also appear if you write your schema by hand or used introspection to create it before: https://github.com/prisma/prisma2/issues/1534
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 18 (11 by maintainers)
This is now fixed ❤️
@janpio @tomhoule Thanks so much :bowtie:
I already added id fields to all tables from the db I want to create the schema for. 😃 But thanks for updating me. I’ll keep a grateful and patient eye on the refactoring.
The PR is not merged, so it’s not in alpha yet 😃 I will try to get a review tomorrow.