|
Bogdan Timofte
authored
4 days ago
|
1
|
# Table: `documents`
|
|
|
2
|
|
|
|
3
|
Legacy document-store table kept only for migration from the first SQLite implementation.
|
|
|
4
|
|
|
|
5
|
The application no longer uses this table as source of truth after relational tables are seeded.
|
|
|
6
|
|
|
|
7
|
## Columns
|
|
|
8
|
|
|
|
9
|
| Column | Type | Null | Default | Notes |
|
|
|
10
|
|--------|------|------|---------|-------|
|
|
|
11
|
| `name` | `TEXT` | no | none | Legacy document name. Known values: `hosts_yaml`, `work_orders_yaml`. |
|
|
|
12
|
| `content` | `TEXT` | no | none | Legacy YAML payload. |
|
|
|
13
|
| `updated_at` | `TEXT` | no | none | Legacy document update timestamp. |
|
|
|
14
|
|
|
|
15
|
## Keys And Indexes
|
|
|
16
|
|
|
|
17
|
- Primary key: `name`
|
|
|
18
|
- SQLite creates the internal primary-key index.
|
|
|
19
|
|
|
|
20
|
## Relationships
|
|
|
21
|
|
|
|
22
|
None. Migration code reads this table and imports the YAML into relational tables when `hosts` or `work_orders` are empty.
|
|
|
23
|
|
|
|
24
|
## Definition
|
|
|
25
|
|
|
|
26
|
```sql
|
|
|
27
|
CREATE TABLE IF NOT EXISTS documents (
|
|
|
28
|
name TEXT PRIMARY KEY,
|
|
|
29
|
content TEXT NOT NULL,
|
|
|
30
|
updated_at TEXT NOT NULL
|
|
|
31
|
);
|
|
|
32
|
```
|