JoinCode
The JoinCode model represents a unique code that allows users to join a specific world. Each world has one join code, and each join code is associated with only one world.
Fields
| Field | Type | Attributes | Description |
|---|---|---|---|
| id | String | @id, @default(cuid()) | Unique join code ID |
| code | String | @unique | The actual join code string |
| worldId | String | @unique | ID of the world this join code belongs to |
| world | World | @relation | The world associated with this join code |
| createdAt | DateTime | @default(now()) | Timestamp when the join code was created |
Relationships
- JoinCode belongs to a World (
worldId). - Each World can have only one JoinCode.
Example Record
{
"id": "joincode1",
"code": "abc123",
"worldId": "world123",
"createdAt": "2025-09-01T18:00:00.000Z",
"world": {
"id": "world123",
"name": "Adventure Realm"
}
}