`prisma format` remembers old columns/relations and re-adds them
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Reproduce the issue with the shown schema.prisma and prisma format, then compare the result after deleting the local prisma/migrations/2026...my_migration folder. Start by locating the prisma format entry point and its schema or migration state handling. Done means deleted relations and columns stay absent after formatting, including for models not yet present in the database.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When I run prisma format, it doesn't just format my schema.prisma file, it also adds columns and relations which I've recently deleted.
Scenario
I have the following model:
model foobars {
id BigInt @id @default(autoincrement())
name String @db.Text
lorem_ipsu String @db.Text
lorem String @db.Text
description String? @db.Text
@@schema("foo")
}
When I run prisma format, it becomes the following (for the sake of brevity, I won't paste the related models here):
model foobars {
id BigInt @id @default(autoincrement())
name String @db.Text
lorem_ipsu String @db.Text
lorem String @db.Text
description String? @db.Text
amets amets? @relation(fields: [ametsId], references: [id])
ametsId BigInt?
dolores options? @relation(fields: [doloresId], references: [id])
doloresId Int?
ipsums ipsums? @relation(fields: [ipsumsId], references: [id])
ipsumsId Int?
@@schema("foo")
}
All the relations and columns added by Prisma used to exist on the model, but I've deleted them.
Note that those are all new models which don't exist in my actual database yet.
One non-standard thing I've done which might have had some impact is that I had created the migration locally with prisma migrate dev --create-only --name my-migration, didn't apply it, then deleted the prisma/migrations/2026...my_migration folder so that I could work some more on my migration then generate a new file.
This may be the same issue as https://github.com/prisma/language-tools/issues/1800
Version
Prisma 7.8.0
- Lingua principale
- TypeScript
- Stelle
- 21
- Fork
- 2
- Merge medio
- 23h 23m
- PR unite (30g)
- 40
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di prisma/prisma-cli
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
prisma/prisma-cli#246 ·
-
installation issue Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
prisma/prisma-cli#237 · 2 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
prisma/prisma-cli#205 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
prisma/prisma-cli#121 ·
Tutte le issue di prisma/prisma-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
copse-dev/agent-pane#2953 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·