generated from john/python-template
This commit is contained in:
+32
-4
@@ -6,10 +6,11 @@ This document is the field-accurate Version 4 schema contract aligned to `src/tr
|
||||
|
||||
- `src/transcription/db/models.py:60-78` (status and purpose enums)
|
||||
- `src/transcription/db/models.py:80-120` (`DocumentType`, `PersonRole`)
|
||||
- `src/transcription/db/models.py:122-207` (`Document`, `Person`, `DocumentPerson`)
|
||||
- `src/transcription/db/models.py:208-255` (`Job`)
|
||||
- `src/transcription/db/models.py:273-386` (`Source`, `JobSource`)
|
||||
- `src/transcription/db/models.py:387-445` (`ExecutionAttempt`)
|
||||
- `src/transcription/db/models.py:122-148` (`Tag`, `Document`)
|
||||
- `src/transcription/db/models.py:149-255` (`Person`, `DocumentPerson`, `DocumentTag`)
|
||||
- `src/transcription/db/models.py:256-303` (`Job`)
|
||||
- `src/transcription/db/models.py:304-417` (`Source`, `JobSource`)
|
||||
- `src/transcription/db/models.py:418-476` (`ExecutionAttempt`)
|
||||
|
||||
## Entity Relationship Overview
|
||||
|
||||
@@ -19,8 +20,10 @@ erDiagram
|
||||
Document ||--o{ Job : has
|
||||
Document ||--o{ Source : has
|
||||
Document ||--o{ DocumentPerson : links
|
||||
Document ||--o{ DocumentTag : tagged
|
||||
Person ||--o{ DocumentPerson : links
|
||||
PersonRole ||--o{ DocumentPerson : labels
|
||||
Tag ||--o{ DocumentTag : labels
|
||||
Job ||--o{ JobSource : includes
|
||||
Source ||--o{ JobSource : participates
|
||||
JobSource ||--o{ ExecutionAttempt : attempts
|
||||
@@ -74,6 +77,18 @@ erDiagram
|
||||
| `created_at` | `datetime` | default now |
|
||||
| `updated_at` | `datetime` | default now, onupdate |
|
||||
|
||||
### `Tag`
|
||||
|
||||
| Field | Type | Notes |
|
||||
| :--- | :--- | :--- |
|
||||
| `id` | `UUID` | PK |
|
||||
| `semantic_key` | `str \| None` | nullable unique, indexed |
|
||||
| `label` | `str` | required |
|
||||
| `normalized_label` | `str` | unique, indexed |
|
||||
| `is_active` | `bool` | default `True` |
|
||||
| `created_at` | `datetime` | default now |
|
||||
| `updated_at` | `datetime` | default now, onupdate |
|
||||
|
||||
### `Document`
|
||||
|
||||
| Field | Type | Notes |
|
||||
@@ -124,6 +139,19 @@ erDiagram
|
||||
Constraint:
|
||||
- `UniqueConstraint(document_id, person_id)` named `uq_document_person`
|
||||
|
||||
### `DocumentTag`
|
||||
|
||||
| Field | Type | Notes |
|
||||
| :--- | :--- | :--- |
|
||||
| `id` | `UUID` | PK |
|
||||
| `document_id` | `UUID` | FK -> `document.id`, indexed |
|
||||
| `tag_id` | `UUID` | FK -> `tag.id`, indexed |
|
||||
| `created_at` | `datetime` | default now |
|
||||
| `updated_at` | `datetime` | default now, onupdate |
|
||||
|
||||
Constraint:
|
||||
- `UniqueConstraint(document_id, tag_id)` named `uq_document_tag`
|
||||
|
||||
### `Job`
|
||||
|
||||
| Field | Type | Notes |
|
||||
|
||||
Reference in New Issue
Block a user