Comments (3)
abstract model AbsModelPadrao {
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
dtHrCriacao DateTime @default(now()) @db.Timestamptz
dtHrAtualizacao DateTime @default(now()) @updatedAt() @db.Timestamptz
}
model Usuario extends AbsModelPadrao {
nome String
sobrenome String?
login String @unique
senha String @password @omit
codIdioma String @default("en_US")
dtFimTeste DateTime @db.Date @default(dbgenerated("(CURRENT_DATE + '30 days'::INTERVAL)")) @deny("update", true)
pin String? @omit
status UsuarioStatus @default(NaoAtivado)
// users can change its own data
@@allow("all", auth() != null && auth().id == id)
@@auth()
alunos Aluno[]
}
abstract model AbsModelDadosDoUsuario {
id String @id @default(dbgenerated("uuid_generate_v7()")) @db.Uuid
usuarioId String @db.Uuid @default(auth().id)
dtHrCriacao DateTime @default(now()) @db.Timestamptz
dtHrAtualizacao DateTime @default(now()) @updatedAt() @db.Timestamptz
// relations
usuario Usuario @relation(fields: [usuarioId], references: [id], onDelete: Cascade)
// allow acess to myself
@@allow("all", auth() != null && auth().id == usuarioId)
@@index([usuarioId])
}
model Aluno extends AbsModelDadosDoUsuario {
nome String
sobrenome String?
celular String?
email String?
observacoes String?
saldoDeAulas Int @default(0)
dtNascimento DateTime? @db.Date
peso Float?
altura Float?
removido Boolean @default(false)
@@prisma.passthrough("@@index([nome(ops: raw(\"gin_trgm_ops\"))], type: Gin, name: \"Aluno_nome_idx\")")
}
from zenstack.
Hi @israelins85 , thanks for reporting this. Could you share a ZModel snippet that can be used to reproduce the problem?
from zenstack.
Hi @israelins85 , I had a try but couldn't reproduce this issue with v2.2.3. I've shared a project here: https://github.com/ymc9/issue-1519
Could you check what differences it may have with your project? Thanks!
from zenstack.
Related Issues (20)
- [Feature Request] Map all prisma commands to zenstack cli
- Model entity create fails when inheriting from a delegate model that extends an abstract model
- adding plugin @core/enhancer breaks validation checks for @core/zod plugin
- validations on reference properties don't work
- Incorrect typing for second argument of tanstack hooks
- [Feature Request] Remove `decimal.js` HOT 1
- RestAPI only returning first result when passing in multiple filters example: user?filter[id]=2,1
- Access policy failure on referenced object properties with overridden policies. HOT 1
- Named relations in polymorphic models causes schema generation error HOT 1
- Argument ID is missing from createManyAndReturn api
- `createMany` field should be excluded from nested create payload for polymorphic models
- Add tanstack-query as peer dependency to `@zenstackhq/tanstack-query`
- [Feature Request] Support creating polymorphic model entities with nested create
- [Feature Request]: utilize `prismaSchemaFolder` preview feature
- Incorrect prisma query executed when `count` using a where filter involving a polymorphic base field
- [Feature Request] Access policy allow field to be created only with default value
- regression: delegate models don't inherit abstract base properties HOT 6
- Errors thrown when using @default together with auth() are normal error objects
- [Feature Request] Prisma 5.17 support HOT 2
- [Feature Request] Allow IntelliSense to automatically add the missing import for ZModel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zenstack.