# DocumentVersion

**Kind:** Database Model

**Source:** [`atloria-monorepo/libs/database/prisma/schema.prisma`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/database/prisma/schema.prisma#L943)

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `documentId` | `String` | ✓ |  |
| `version` | `Int` | ✓ |  |
| `label` | `String` | - |  |
| `comment` | `String` | - |  |
| `content` | `String` | ✓ |  |
| `title` | `String` | - |  |
| `metadata` | `Json` | - |  |
| `createdAt` | `DateTime` | ✓ |  |
| `createdById` | `String` | ✓ |  |

## Diagram

```mermaid
erDiagram
    DocumentVersion {
        id String [PK]
        documentId String
        version Int
        label String?
        comment String?
        content String
        title String?
        metadata Json?
        createdAt DateTime
        createdById String
    }
    DocumentVersion ||--|| Document : ""
    DocumentVersion ||--|| User : ""
```

## Relationships

- HAS_ONE → `Document`
- HAS_ONE → `User`

## Referenced By

- `User` (HAS_ONE)
