Relation fields are removed after npx prisma db pull
See original GitHub issueBug description
Virtual fields are removed after npx prisma db pull
How to reproduce
If you do npx prisma db pull
the answers
and candidate
fields will be removed
Expected behavior
npx prisma db pull
won’t remove virtual fields
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model Answer {
id Int @id @default(autoincrement())
candidateId Int? @map("candidate_id")
candidate Candidate? @relation(fields: [candidateId], references: [id])
shortCode String? @map("short_code") @db.VarChar(10)
@@map("answer")
}
model Candidate {
id Int @id @default(autoincrement())
shortCode String? @map("short_code") @db.VarChar(10)
answers Answer[]
@@map("candidate")
}
Environment & setup
- OS: macOS 12.4
- Database: PlanetScale
- Node.js version: v16.14.2
Prisma Version
prisma : 4.5.0
@prisma/client : ^4.5.0
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at ../../../.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Format Wasm : @prisma/prisma-fmt-wasm 4.5.0-43.0362da9eebca54d94c8ef5edd3b2e90af99ba452
Default Engines Hash : 0362da9eebca54d94c8ef5edd3b2e90af99ba452
Studio : 0.476.0
Preview Features : referentialIntegrity
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Prisma CLI Command Reference
This page gives an overview of all available Prisma CLI commands, explains their options and shows numerous usage examples.
Read more >Migration troubleshooting in development
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >What is introspection? (Reference)
You can introspect your database using the prisma db pull command of the Prisma CLI. Note that using this command requires your connection...
Read more >CRUD (Reference)
This page describes how to perform CRUD operations with your generated Prisma Client API. CRUD is an acronym that stands for: Create; Read;...
Read more >Customize a migration file
To actually rename a field and avoid data loss when you run the migration in production, you need to modify the generated migration...
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
Thank you so much! I love Prisma!
@Jolg42 sorry, I’ve removed most fields to make it easy to read for you and missed that line.
These are the untouched tables
and