Skip to content

Inherited fields from abstract model should appear in the top #486

@jiashengguo

Description

@jiashengguo
abstract model Base {
    id Int @id @default(autoincrement())
    createdAt DateTime @default(now())
    updatedAt DateTime @updatedAt()
    //Logged-in users can view
    @@allow('read', auth() != null)
}
model Post extends Base
{
    title String
    content String?
    viewCount Int @default(0)
}

The generated prisma file should be:

/// @@allow('all', auth() != null && published)
model Post {
    id Int @id() @default(autoincrement())
    createdAt DateTime @default(now())
    updatedAt DateTime @updatedAt()
    published Boolean @default(true)
    zenstack_guard Boolean @default(true)
    zenstack_transaction String?
    title String
    content String?
    viewCount Int @default(0)
    comment Comment[]

    @@index([zenstack_transaction])
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions