Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous rotation migrations are disabled warning #99

Open
troykelly opened this issue Feb 20, 2024 · 2 comments
Open

Erroneous rotation migrations are disabled warning #99

troykelly opened this issue Feb 20, 2024 · 2 comments

Comments

@troykelly
Copy link

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

[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

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])
}
@franky47
Copy link
Member

franky47 commented Feb 20, 2024

If you follow the link in the error, you'll see in the documentation that:

Note: Compound @@id primary keys are not supported.

Would you like to open a PR to add support?

Otherwise, an immediate solution would be to add a @unique auto-incrementing integer column to act as the cursor.

@troykelly
Copy link
Author

Apologies, I did spend some time in the documentation, and I missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants