47ng / 47ng/prisma-field-encryption

Erroneous `rotation migrations are disabled` warning

Aperta
#99 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
306
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Comment

There is an id/unique on the model, it's not just a single field. I can't see how to disable the warning or how to resolve it.

## Error Text

```text
[prisma-field-encryption] Warning: could not find a field to use to iterate over rows in model RetailerDistributor.
Automatic encryption/decryption/key rotation migrations are disabled for this model.
Read more: https://github.com/47ng/prisma-field-encryption#migrations
```

## Relevant Schema

```text
model RetailerDistributor {
retailerId String
distributorId String
isActive Boolean @default(true)
authJsonString String? /// @encrypted
retailer Retailer @relation(fields: [retailerId], references: [id])
distributor Distributor @relation(fields: [distributorId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@id([retailerId, distributorId])
}
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The warning is triggered when the library cannot find a field to iterate over rows in the RetailerDistributor model. Examine the migration logic in the source code, likely in a file handling model scanning or key rotation. Check how composite IDs are detected versus single unique fields. The goal is to make the library recognize the @@id([retailerId, distributorId]) as a valid iteration key, thereby enabling migrations for this model.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
backend, databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.