Skip to content

@@validate attribute, looking only one level deep into abstract models #971

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

Closed
AlekseiAQ opened this issue Jan 29, 2024 · 0 comments
Closed
Milestone

Comments

@AlekseiAQ
Copy link

Description and expected behavior
@@Validate attribute, looking only one level deep into abstract models. It should be looking into all the models.
Example:

abstract model Level1 {
    id String @id @default(cuid())
    URL String?
    @@validate(URL != null, "URL must be provided") // works
}
abstract model Level2 extends Level1 {
    @@validate(URL != null, "URL must be provided") // works 
}
abstract model Level3 extends Level2 {
    @@validate(URL != null, "URL must be provided") // doesn't work
}

Error message at Level3 model:

Could not resolve reference to ReferenceTarget named 'URL'.zmodel(linking-error)
expression cannot be resolvedzmodel

Screenshots
n/a

Environment (please complete the following information):

  • ZenStack version: "zenstack": "1.7.1"
  • Prisma version: "prisma": "^5.8.1"
  • Database type: Planetscale mysql

Additional context
n/a

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