//////////////////////////////////////////////////////////////////////////////////////////////
// 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 //
//////////////////////////////////////////////////////////////////////////////////////////////
Represents a user's membership in a team with a specific role.
Category: Identity · Defined in: showcase.zmodel
Declaration · showcase.zmodel
model TeamMember with Timestamps {
id String @id @default(cuid())
user User @relation(fields: [userId], references: [id])
userId String
team Team @relation(fields: [teamId], references: [id])
teamId String
role Role @default(MEMBER)
@@unique([userId, teamId])
@@allow('read', true)
@@meta('doc:category', 'Identity')
}On this page: Mixins · Fields · Relationships · Access Policies · Indexes
Reusable field groups mixed into this model.
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 |
— | — |
user |
User | Yes | — | @relation(fields: [userId], references: [id]) |
— | — |
userId |
String |
Yes | — | — | — | — |
team |
Team | Yes | — | @relation(fields: [teamId], references: [id]) |
— | — |
teamId |
String |
Yes | — | — | — | — |
role |
Role | Yes | MEMBER |
— | — | — |
Foreign key relationships to other models in the schema.
| Field | Related Model | Type |
|---|---|---|
team |
Team | Many→One |
user |
User | Many→One |
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 |
Database indexes defined on this model for query performance.
| Fields | Type |
|---|---|
[userId, teamId] |
Unique |