Skip to content

Latest commit

 

History

History
106 lines (72 loc) · 3.49 KB

File metadata and controls

106 lines (72 loc) · 3.49 KB
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE                                                                  //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: showcase.zmodel · Generated: 2026-02-23                                          //
//////////////////////////////////////////////////////////////////////////////////////////////

Index / Models / Comment

🗃️ Comment Model

A comment on a task. Comments do not have descriptions intentionally to test the plugin's handling of undocumented fields.

Category: Work · Defined in: showcase.zmodel


Declaration · showcase.zmodel
model Comment with Timestamps {
    id       String @id @default(cuid())
    body     String
    task     Task   @relation(fields: [taskId], references: [id])
    taskId   String
    author   User   @relation(fields: [authorId], references: [id])
    authorId String

    @@allow('read', true)
    @@allow('create', true)
    @@allow('update,delete', author == auth())
    @@meta('doc:category', 'Work')
}

On this page: Mixins · Fields · Relationships · Access Policies

🧩 Mixins

Reusable field groups mixed into this model.

📋 Fields

All fields defined on this entity, including inherited fields from mixins and parent models.

Field Type Required Default Attributes Source Description
createdAt DateTime Yes now() Timestamps
updatedAt DateTime Yes @updatedAt Timestamps
id String Yes cuid() @id
body String Yes
task Task Yes @relation(fields: [taskId], references: [id])
taskId String Yes
author User Yes @relation(fields: [authorId], references: [id])
authorId String Yes

🔗 Relationships

Foreign key relationships to other models in the schema.

Field Related Model Type
author User Many→One
task Task Many→One

diagram

🔐 Access Policies

ZenStack access control rules that determine who can read, create, update, or delete records.

Important

Operations are denied by default. @@allow rules grant access; @@deny rules override any allow.

Operation Rule Effect
read true Allow
create true Allow
update,delete author == auth() Allow

📚 References


Previous: Activity · Next: Organization