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

[BUG] "Could not resolve reference to DataModelField" when using abstract field in future() #1695

Closed
onimitch opened this issue Sep 11, 2024 · 3 comments
Milestone

Comments

@onimitch
Copy link

onimitch commented Sep 11, 2024

Description and expected behavior

abstract model SoftDelete {
    deleted Int @default(0) @omit
}

model MyModel extends SoftDelete {
    id      String @id @default(cuid())
    name    String

    @@deny('update', deleted != 0 && future().deleted != 0)
}

The above @deny rule errors: Could not resolve reference to DataModelField named 'deleted'.

Workaround for now: Place the deny rule in the abstract model.

Environment (please complete the following information)

  • ZenStack version: 2.5.1
  • Prisma version: 5.18.0
  • Database type: Postgresql
@ymc9
Copy link
Member

ymc9 commented Sep 11, 2024

Thanks for reporting this @onimitch . I'll confirm and make a fix soon.

@ymc9
Copy link
Member

ymc9 commented Sep 23, 2024

Fixed in 2.6.0

@ymc9 ymc9 closed this as completed Sep 23, 2024
@onimitch
Copy link
Author

@ymc9 thanks!

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

No branches or pull requests

2 participants