prisma format does not work correctly
See original GitHub issueBug description
prisma format
adds relations in the wrong model
How to reproduce
Before saving After Saving
Expected behavior
It suppose to be
Prisma information
prisma : 4.6.1 @prisma/client : Not found Current platform : darwin Query Engine (Node-API) : libquery-engine 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node) Migration Engine : migration-engine-cli 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/migration-engine-darwin) Introspection Engine : introspection-core 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/introspection-engine-darwin) Format Binary : prisma-fmt 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/prisma-fmt-darwin) Format Wasm : @prisma/prisma-fmt-wasm 4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32 Default Engines Hash : 694eea289a8462c80264df36757e4fdc129b1b32 Studio : 0.476.0
Environment & setup
- OS: macOS
- Database:PostgreSQL
- Node.js version: v16.14.2
Prisma Version
4.6.1
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Similar question then: How should Prisma know if you want to do a 1:1 or a 1:n relation? We seem to have made the decision that a 1:n is more probable and default to that.
@tomhoule how can you say that both are equally valid ? The “wrong” format created an array type I agree that they are 2 choices when it comes to apply a 1 - 1 relation, but in both of them, there is no array type… I would expect (at least) to get something like
user User
in theProfile
model.