agentic-domain-document 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tbls.yml +201 -0
- package/CHANGELOG.md +68 -0
- package/README.md +313 -0
- package/agent/agent.manifest.json +8 -0
- package/agent/capabilities/document-authoring.json +21 -0
- package/agent/capabilities/document-block.json +22 -0
- package/agent/capabilities/document-toc.json +21 -0
- package/agent/capabilities/document-validation.json +21 -0
- package/agent/examples/document-quality-examples.md +153 -0
- package/agent/examples/examples.md +172 -0
- package/agent/guides/10-document-authoring-guide.md +28 -0
- package/agent/guides/20-domain-boundary-guide.md +41 -0
- package/agent/guides/30-authoring-policy-guide.md +40 -0
- package/agent/guides/40-toc-authoring-guide.md +73 -0
- package/agent/guides/50-content-block-guide.md +57 -0
- package/agent/guides/51-paragraph-authoring-guide.md +68 -0
- package/agent/guides/52-table-authoring-guide.md +73 -0
- package/agent/guides/53-diagram-figure-authoring-guide.md +75 -0
- package/agent/guides/70-korean-writing-style-guide.md +65 -0
- package/agent/instructions/00-runtime-behavior.md +17 -0
- package/agent/instructions/10-scope-and-boundary.md +27 -0
- package/agent/instructions/20-task-procedures.md +69 -0
- package/agent/instructions/30-must-and-must-not.md +34 -0
- package/agent/resource-index.json +185 -0
- package/agent/resource-selection.json +205 -0
- package/agent/routing.json +34 -0
- package/agent/sources/reference-mapping.md +53 -0
- package/agent/validation/document-validation-rules.md +73 -0
- package/dist/agent/document-agent-contribution.d.ts +15 -0
- package/dist/agent/document-agent-contribution.d.ts.map +1 -0
- package/dist/agent/document-agent-contribution.js +39 -0
- package/dist/agent/document-agent-contribution.js.map +1 -0
- package/dist/agent/index.d.ts +2 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +2 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/database.d.ts +8 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +76 -0
- package/dist/database.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-importer.d.ts +14 -0
- package/dist/markdown-importer.d.ts.map +1 -0
- package/dist/markdown-importer.js +386 -0
- package/dist/markdown-importer.js.map +1 -0
- package/dist/reader.d.ts +17 -0
- package/dist/reader.d.ts.map +1 -0
- package/dist/reader.js +332 -0
- package/dist/reader.js.map +1 -0
- package/dist/repositories.d.ts +118 -0
- package/dist/repositories.d.ts.map +1 -0
- package/dist/repositories.js +388 -0
- package/dist/repositories.js.map +1 -0
- package/dist/service.d.ts +35 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +327 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +276 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validators.d.ts +4 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +255 -0
- package/dist/validators.js.map +1 -0
- package/docs/build.md +55 -0
- package/docs/configuration.md +34 -0
- package/docs/delivery.md +50 -0
- package/docs/operations.md +50 -0
- package/docs/publishing.md +69 -0
- package/docs/schema/generated/README.md +30 -0
- package/docs/schema/generated/document_annotations.md +119 -0
- package/docs/schema/generated/document_annotations.svg +60 -0
- package/docs/schema/generated/document_blocks.md +97 -0
- package/docs/schema/generated/document_blocks.svg +60 -0
- package/docs/schema/generated/document_change_events.md +135 -0
- package/docs/schema/generated/document_change_events.svg +88 -0
- package/docs/schema/generated/document_code_groups.md +70 -0
- package/docs/schema/generated/document_code_groups.svg +52 -0
- package/docs/schema/generated/document_codes.md +88 -0
- package/docs/schema/generated/document_codes.svg +52 -0
- package/docs/schema/generated/document_contents.md +87 -0
- package/docs/schema/generated/document_contents.svg +116 -0
- package/docs/schema/generated/document_documents.md +126 -0
- package/docs/schema/generated/document_documents.svg +222 -0
- package/docs/schema/generated/document_node_taxonomies.md +84 -0
- package/docs/schema/generated/document_node_taxonomies.svg +80 -0
- package/docs/schema/generated/document_node_taxonomy_levels.md +91 -0
- package/docs/schema/generated/document_node_taxonomy_levels.svg +52 -0
- package/docs/schema/generated/document_nodes.md +120 -0
- package/docs/schema/generated/document_nodes.svg +98 -0
- package/docs/schema/generated/document_revisions.md +107 -0
- package/docs/schema/generated/document_revisions.svg +116 -0
- package/docs/schema/generated/document_versions.md +126 -0
- package/docs/schema/generated/document_versions.svg +88 -0
- package/docs/schema/generated/schema.json +2534 -0
- package/docs/schema/generated/schema.mmd +170 -0
- package/docs/schema/generated/schema.svg +331 -0
- package/docs/schema/migrations.md +40 -0
- package/docs/usage.md +332 -0
- package/docs/validation-rules.md +69 -0
- package/package.json +30 -0
- package/src/database/migrations/0001_document_base.sql +753 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# document_code_groups
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
코드 그룹을 정의한다.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE TABLE document_code_groups (
|
|
12
|
+
-- 코드 그룹 식별자
|
|
13
|
+
code_group_code VARCHAR(64) PRIMARY KEY,
|
|
14
|
+
|
|
15
|
+
-- 코드 그룹 한글명
|
|
16
|
+
code_group_name VARCHAR(128) NOT NULL,
|
|
17
|
+
|
|
18
|
+
-- 코드 그룹 설명
|
|
19
|
+
description TEXT,
|
|
20
|
+
|
|
21
|
+
-- 표시 정렬 순서
|
|
22
|
+
sort_order INTEGER NOT NULL DEFAULT 0,
|
|
23
|
+
|
|
24
|
+
-- 활성 여부. 1은 활성, 0은 비활성
|
|
25
|
+
is_active INTEGER NOT NULL DEFAULT 1
|
|
26
|
+
CHECK (is_active IN (0, 1)),
|
|
27
|
+
|
|
28
|
+
-- 생성 시각
|
|
29
|
+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
30
|
+
|
|
31
|
+
-- 수정 시각
|
|
32
|
+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
</details>
|
|
37
|
+
|
|
38
|
+
## Columns
|
|
39
|
+
|
|
40
|
+
| Name | Type | Default | Nullable | Children | Comment |
|
|
41
|
+
| --------------- | ------------ | ----------------- | -------- | ----------------------------------- | ---------------- |
|
|
42
|
+
| code_group_code | VARCHAR(64) | | true | [document_codes](document_codes.md) | 코드 그룹 식별자 |
|
|
43
|
+
| code_group_name | VARCHAR(128) | | false | | 코드 그룹 한글명 |
|
|
44
|
+
| description | TEXT | | true | | 코드 그룹 설명 |
|
|
45
|
+
| sort_order | INTEGER | 0 | false | | 표시 정렬 순서 |
|
|
46
|
+
| is_active | INTEGER | 1 | false | | 활성 여부 |
|
|
47
|
+
| created_at | DATETIME | CURRENT_TIMESTAMP | false | | 생성 시각 |
|
|
48
|
+
| updated_at | DATETIME | CURRENT_TIMESTAMP | false | | 수정 시각 |
|
|
49
|
+
|
|
50
|
+
## Constraints
|
|
51
|
+
|
|
52
|
+
| Name | Type | Definition |
|
|
53
|
+
| --------------------------------------- | ----------- | ----------------------------- |
|
|
54
|
+
| code_group_code | PRIMARY KEY | PRIMARY KEY (code_group_code) |
|
|
55
|
+
| sqlite_autoindex_document_code_groups_1 | PRIMARY KEY | PRIMARY KEY (code_group_code) |
|
|
56
|
+
| - | CHECK | CHECK (is_active IN (0, 1)) |
|
|
57
|
+
|
|
58
|
+
## Indexes
|
|
59
|
+
|
|
60
|
+
| Name | Definition |
|
|
61
|
+
| --------------------------------------- | ----------------------------- |
|
|
62
|
+
| sqlite_autoindex_document_code_groups_1 | PRIMARY KEY (code_group_code) |
|
|
63
|
+
|
|
64
|
+
## Relations
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: document_code_groups Pages: 1 -->
|
|
7
|
+
<svg width="443pt" height="422pt"
|
|
8
|
+
viewBox="0.00 0.00 443.47 421.77" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 417.77)">
|
|
10
|
+
<title>document_code_groups</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-417.77 439.47,-417.77 439.47,4 -4,4"/>
|
|
12
|
+
<!-- document_code_groups -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>document_code_groups</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-91.57 46.2,-137.57 370.67,-137.57 370.67,-91.57 46.2,-91.57"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-91.57 46.2,-137.57 370.67,-137.57 370.67,-91.57 46.2,-91.57"/>
|
|
17
|
+
<text text-anchor="start" x="87.83" y="-115.37" font-family="Arial Bold" font-size="18.00">document_code_groups</text>
|
|
18
|
+
<text text-anchor="start" x="259.79" y="-115.37" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="290.9" y="-115.37" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
20
|
+
<text text-anchor="start" x="150.09" y="-100.97" font-family="Arial" font-size="14.00" fill="#333333">코드 그룹을 정의한다.</text>
|
|
21
|
+
<polygon fill="none" stroke="black" points="46.2,-60.77 46.2,-91.57 370.67,-91.57 370.67,-60.77 46.2,-60.77"/>
|
|
22
|
+
<text text-anchor="start" x="53.2" y="-72.97" font-family="Arial" font-size="14.00">code_group_code </text>
|
|
23
|
+
<text text-anchor="start" x="169.19" y="-72.97" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(64)]</text>
|
|
24
|
+
<text text-anchor="start" x="270.32" y="-72.97" font-family="Arial" font-size="14.00"> 코드 그룹 식별자</text>
|
|
25
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-59.27 44.7,-139.07 372.17,-139.07 372.17,-59.27 44.7,-59.27"/>
|
|
26
|
+
</g>
|
|
27
|
+
<!-- document_codes -->
|
|
28
|
+
<g id="node2" class="node">
|
|
29
|
+
<title>document_codes</title>
|
|
30
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-324.57 46.2,-370.57 370.67,-370.57 370.67,-324.57 46.2,-324.57"/>
|
|
31
|
+
<polygon fill="none" stroke="black" points="46.2,-324.57 46.2,-370.57 370.67,-370.57 370.67,-324.57 46.2,-324.57"/>
|
|
32
|
+
<text text-anchor="start" x="113.32" y="-348.37" font-family="Arial Bold" font-size="18.00">document_codes</text>
|
|
33
|
+
<text text-anchor="start" x="234.29" y="-348.37" font-family="Arial" font-size="14.00"> </text>
|
|
34
|
+
<text text-anchor="start" x="265.41" y="-348.37" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
35
|
+
<text text-anchor="start" x="122.86" y="-333.97" font-family="Arial" font-size="14.00" fill="#333333">코드 그룹별 코드 값을 정의한다.</text>
|
|
36
|
+
<polygon fill="none" stroke="black" points="46.2,-293.77 46.2,-324.57 370.67,-324.57 370.67,-293.77 46.2,-293.77"/>
|
|
37
|
+
<text text-anchor="start" x="53.2" y="-305.97" font-family="Arial" font-size="14.00">code_group_code </text>
|
|
38
|
+
<text text-anchor="start" x="169.19" y="-305.97" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(64)]</text>
|
|
39
|
+
<text text-anchor="start" x="270.32" y="-305.97" font-family="Arial" font-size="14.00"> 코드 그룹 식별자</text>
|
|
40
|
+
<polygon fill="none" stroke="black" points="46.2,-262.97 46.2,-293.77 370.67,-293.77 370.67,-262.97 46.2,-262.97"/>
|
|
41
|
+
<text text-anchor="start" x="53.2" y="-275.17" font-family="Arial" font-size="14.00">code </text>
|
|
42
|
+
<text text-anchor="start" x="87.45" y="-275.17" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(128)]</text>
|
|
43
|
+
<text text-anchor="start" x="196.37" y="-275.17" font-family="Arial" font-size="14.00"> 코드 값</text>
|
|
44
|
+
</g>
|
|
45
|
+
<!-- document_codes->document_code_groups -->
|
|
46
|
+
<g id="edge1" class="edge">
|
|
47
|
+
<title>document_codes:code_group_code->document_code_groups:code_group_code</title>
|
|
48
|
+
<path fill="none" stroke="black" d="M381.55,-306.96C431,-284.52 454.05,-98.13 416.87,-60.77 351.52,4.89 208.43,32.87 208.43,-59.77"/>
|
|
49
|
+
<polygon fill="black" stroke="black" points="381.75,-306.91 371.01,-304.7 376.55,-308.08 372.32,-309.02 372.32,-309.02 372.32,-309.02 376.55,-308.08 372.98,-313.49 381.75,-306.91"/>
|
|
50
|
+
</g>
|
|
51
|
+
</g>
|
|
52
|
+
</svg>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# document_codes
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
코드 그룹별 코드 값을 정의한다.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE TABLE document_codes (
|
|
12
|
+
-- 코드 그룹 식별자
|
|
13
|
+
code_group_code VARCHAR(64) NOT NULL,
|
|
14
|
+
|
|
15
|
+
-- 코드 값. lower_snake_case를 사용한다.
|
|
16
|
+
code VARCHAR(128) NOT NULL,
|
|
17
|
+
|
|
18
|
+
-- 코드 한글명
|
|
19
|
+
code_name VARCHAR(128) NOT NULL,
|
|
20
|
+
|
|
21
|
+
-- 코드 설명
|
|
22
|
+
description TEXT,
|
|
23
|
+
|
|
24
|
+
-- 표시 정렬 순서
|
|
25
|
+
sort_order INTEGER NOT NULL DEFAULT 0,
|
|
26
|
+
|
|
27
|
+
-- 활성 여부. 1은 활성, 0은 비활성
|
|
28
|
+
is_active INTEGER NOT NULL DEFAULT 1
|
|
29
|
+
CHECK (is_active IN (0, 1)),
|
|
30
|
+
|
|
31
|
+
-- 확장 메타데이터
|
|
32
|
+
metadata_json JSON
|
|
33
|
+
CHECK (metadata_json IS NULL OR json_valid(metadata_json)),
|
|
34
|
+
|
|
35
|
+
-- 생성 시각
|
|
36
|
+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
37
|
+
|
|
38
|
+
-- 수정 시각
|
|
39
|
+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
40
|
+
|
|
41
|
+
PRIMARY KEY (code_group_code, code),
|
|
42
|
+
|
|
43
|
+
FOREIGN KEY (code_group_code)
|
|
44
|
+
REFERENCES document_code_groups (code_group_code)
|
|
45
|
+
ON DELETE CASCADE
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</details>
|
|
50
|
+
|
|
51
|
+
## Columns
|
|
52
|
+
|
|
53
|
+
| Name | Type | Default | Nullable | Parents | Comment |
|
|
54
|
+
| --------------- | ------------ | ----------------- | -------- | ----------------------------------------------- | ---------------- |
|
|
55
|
+
| code_group_code | VARCHAR(64) | | false | [document_code_groups](document_code_groups.md) | 코드 그룹 식별자 |
|
|
56
|
+
| code | VARCHAR(128) | | false | | 코드 값 |
|
|
57
|
+
| code_name | VARCHAR(128) | | false | | 코드 한글명 |
|
|
58
|
+
| description | TEXT | | true | | 코드 설명 |
|
|
59
|
+
| sort_order | INTEGER | 0 | false | | 표시 정렬 순서 |
|
|
60
|
+
| is_active | INTEGER | 1 | false | | 활성 여부 |
|
|
61
|
+
| metadata_json | JSON | | true | | 확장 메타데이터 |
|
|
62
|
+
| created_at | DATETIME | CURRENT_TIMESTAMP | false | | 생성 시각 |
|
|
63
|
+
| updated_at | DATETIME | CURRENT_TIMESTAMP | false | | 수정 시각 |
|
|
64
|
+
|
|
65
|
+
## Constraints
|
|
66
|
+
|
|
67
|
+
| Name | Type | Definition |
|
|
68
|
+
| --------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| code_group_code | PRIMARY KEY | PRIMARY KEY (code_group_code) |
|
|
70
|
+
| code | PRIMARY KEY | PRIMARY KEY (code) |
|
|
71
|
+
| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (code_group_code) REFERENCES document_code_groups (code_group_code) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE |
|
|
72
|
+
| sqlite_autoindex_document_codes_1 | PRIMARY KEY | PRIMARY KEY (code_group_code, code) |
|
|
73
|
+
| - | CHECK | CHECK (is_active IN (0, 1)) |
|
|
74
|
+
| - | CHECK | CHECK (metadata_json IS NULL OR json_valid(metadata_json)) |
|
|
75
|
+
|
|
76
|
+
## Indexes
|
|
77
|
+
|
|
78
|
+
| Name | Definition |
|
|
79
|
+
| --------------------------------- | ----------------------------------- |
|
|
80
|
+
| sqlite_autoindex_document_codes_1 | PRIMARY KEY (code_group_code, code) |
|
|
81
|
+
|
|
82
|
+
## Relations
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: document_codes Pages: 1 -->
|
|
7
|
+
<svg width="441pt" height="424pt"
|
|
8
|
+
viewBox="0.00 0.00 441.10 423.90" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 419.9)">
|
|
10
|
+
<title>document_codes</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-419.9 437.1,-419.9 437.1,4 -4,4"/>
|
|
12
|
+
<!-- document_codes -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>document_codes</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-323.7 46.2,-369.7 370.67,-369.7 370.67,-323.7 46.2,-323.7"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="46.2,-323.7 46.2,-369.7 370.67,-369.7 370.67,-323.7 46.2,-323.7"/>
|
|
17
|
+
<text text-anchor="start" x="113.32" y="-347.5" font-family="Arial Bold" font-size="18.00">document_codes</text>
|
|
18
|
+
<text text-anchor="start" x="234.29" y="-347.5" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="265.41" y="-347.5" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
20
|
+
<text text-anchor="start" x="122.86" y="-333.1" font-family="Arial" font-size="14.00" fill="#333333">코드 그룹별 코드 값을 정의한다.</text>
|
|
21
|
+
<polygon fill="none" stroke="black" points="46.2,-292.9 46.2,-323.7 370.67,-323.7 370.67,-292.9 46.2,-292.9"/>
|
|
22
|
+
<text text-anchor="start" x="53.2" y="-305.1" font-family="Arial" font-size="14.00">code_group_code </text>
|
|
23
|
+
<text text-anchor="start" x="169.19" y="-305.1" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(64)]</text>
|
|
24
|
+
<text text-anchor="start" x="270.32" y="-305.1" font-family="Arial" font-size="14.00"> 코드 그룹 식별자</text>
|
|
25
|
+
<polygon fill="none" stroke="black" points="46.2,-262.1 46.2,-292.9 370.67,-292.9 370.67,-262.1 46.2,-262.1"/>
|
|
26
|
+
<text text-anchor="start" x="53.2" y="-274.3" font-family="Arial" font-size="14.00">code </text>
|
|
27
|
+
<text text-anchor="start" x="87.45" y="-274.3" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(128)]</text>
|
|
28
|
+
<text text-anchor="start" x="196.37" y="-274.3" font-family="Arial" font-size="14.00"> 코드 값</text>
|
|
29
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="44.7,-260.6 44.7,-371.2 372.17,-371.2 372.17,-260.6 44.7,-260.6"/>
|
|
30
|
+
</g>
|
|
31
|
+
<!-- document_code_groups -->
|
|
32
|
+
<g id="node2" class="node">
|
|
33
|
+
<title>document_code_groups</title>
|
|
34
|
+
<polygon fill="#efefef" stroke="none" points="46.2,-90.7 46.2,-136.7 370.67,-136.7 370.67,-90.7 46.2,-90.7"/>
|
|
35
|
+
<polygon fill="none" stroke="black" points="46.2,-90.7 46.2,-136.7 370.67,-136.7 370.67,-90.7 46.2,-90.7"/>
|
|
36
|
+
<text text-anchor="start" x="87.83" y="-114.5" font-family="Arial Bold" font-size="18.00">document_code_groups</text>
|
|
37
|
+
<text text-anchor="start" x="259.79" y="-114.5" font-family="Arial" font-size="14.00"> </text>
|
|
38
|
+
<text text-anchor="start" x="290.9" y="-114.5" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
39
|
+
<text text-anchor="start" x="150.09" y="-100.1" font-family="Arial" font-size="14.00" fill="#333333">코드 그룹을 정의한다.</text>
|
|
40
|
+
<polygon fill="none" stroke="black" points="46.2,-59.9 46.2,-90.7 370.67,-90.7 370.67,-59.9 46.2,-59.9"/>
|
|
41
|
+
<text text-anchor="start" x="53.2" y="-72.1" font-family="Arial" font-size="14.00">code_group_code </text>
|
|
42
|
+
<text text-anchor="start" x="169.19" y="-72.1" font-family="Arial" font-size="14.00" fill="#666666">[VARCHAR(64)]</text>
|
|
43
|
+
<text text-anchor="start" x="270.32" y="-72.1" font-family="Arial" font-size="14.00"> 코드 그룹 식별자</text>
|
|
44
|
+
</g>
|
|
45
|
+
<!-- document_codes->document_code_groups -->
|
|
46
|
+
<g id="edge1" class="edge">
|
|
47
|
+
<title>document_codes:code_group_code->document_code_groups:code_group_code</title>
|
|
48
|
+
<path fill="none" stroke="black" d="M381.8,-305.95C430.62,-282.87 450.89,-97.11 413.87,-59.9 349.46,4.82 208.43,32.4 208.43,-58.9"/>
|
|
49
|
+
<polygon fill="black" stroke="black" points="381.73,-305.96 370.98,-303.84 376.54,-307.17 372.32,-308.15 372.32,-308.15 372.32,-308.15 376.54,-307.17 373.01,-312.61 381.73,-305.96"/>
|
|
50
|
+
</g>
|
|
51
|
+
</g>
|
|
52
|
+
</svg>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# document_contents
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
특정 document node에 붙는 block collection을 관리한다.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE TABLE document_contents (
|
|
12
|
+
-- content 식별자
|
|
13
|
+
content_id CHAR(36) PRIMARY KEY
|
|
14
|
+
CHECK (length(content_id) = 36),
|
|
15
|
+
|
|
16
|
+
-- 소속 문서 식별자
|
|
17
|
+
document_id CHAR(36) NOT NULL
|
|
18
|
+
CHECK (length(document_id) = 36),
|
|
19
|
+
|
|
20
|
+
-- 소속 노드 식별자
|
|
21
|
+
node_id CHAR(36) NOT NULL
|
|
22
|
+
CHECK (length(node_id) = 36),
|
|
23
|
+
|
|
24
|
+
-- 생성 시각
|
|
25
|
+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
26
|
+
|
|
27
|
+
-- 수정 시각
|
|
28
|
+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
29
|
+
|
|
30
|
+
-- 확장 메타데이터
|
|
31
|
+
metadata_json JSON
|
|
32
|
+
CHECK (metadata_json IS NULL OR json_valid(metadata_json)),
|
|
33
|
+
|
|
34
|
+
FOREIGN KEY (document_id)
|
|
35
|
+
REFERENCES document_documents (document_id)
|
|
36
|
+
ON DELETE CASCADE,
|
|
37
|
+
|
|
38
|
+
FOREIGN KEY (node_id)
|
|
39
|
+
REFERENCES document_nodes (node_id)
|
|
40
|
+
ON DELETE CASCADE,
|
|
41
|
+
|
|
42
|
+
UNIQUE (node_id)
|
|
43
|
+
)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</details>
|
|
47
|
+
|
|
48
|
+
## Columns
|
|
49
|
+
|
|
50
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
51
|
+
| ------------- | -------- | ----------------- | -------- | ------------------------------------- | ------------------------------------------- | ---------------- |
|
|
52
|
+
| content_id | CHAR(36) | | true | [document_blocks](document_blocks.md) | | content 식별자 |
|
|
53
|
+
| document_id | CHAR(36) | | false | | [document_documents](document_documents.md) | 소속 문서 식별자 |
|
|
54
|
+
| node_id | CHAR(36) | | false | | [document_nodes](document_nodes.md) | 소속 노드 식별자 |
|
|
55
|
+
| created_at | DATETIME | CURRENT_TIMESTAMP | false | | | 생성 시각 |
|
|
56
|
+
| updated_at | DATETIME | CURRENT_TIMESTAMP | false | | | 수정 시각 |
|
|
57
|
+
| metadata_json | JSON | | true | | | 확장 메타데이터 |
|
|
58
|
+
|
|
59
|
+
## Constraints
|
|
60
|
+
|
|
61
|
+
| Name | Type | Definition |
|
|
62
|
+
| ------------------------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| content_id | PRIMARY KEY | PRIMARY KEY (content_id) |
|
|
64
|
+
| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (node_id) REFERENCES document_nodes (node_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE |
|
|
65
|
+
| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (document_id) REFERENCES document_documents (document_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE |
|
|
66
|
+
| sqlite_autoindex_document_contents_2 | UNIQUE | UNIQUE (node_id) |
|
|
67
|
+
| sqlite_autoindex_document_contents_1 | PRIMARY KEY | PRIMARY KEY (content_id) |
|
|
68
|
+
| - | CHECK | CHECK (length(content_id) = 36) |
|
|
69
|
+
| - | CHECK | CHECK (length(document_id) = 36) |
|
|
70
|
+
| - | CHECK | CHECK (length(node_id) = 36) |
|
|
71
|
+
| - | CHECK | CHECK (metadata_json IS NULL OR json_valid(metadata_json)) |
|
|
72
|
+
|
|
73
|
+
## Indexes
|
|
74
|
+
|
|
75
|
+
| Name | Definition |
|
|
76
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------- |
|
|
77
|
+
| idx_document_contents_document | CREATE INDEX idx_document_contents_document<br /> ON document_contents (document_id) |
|
|
78
|
+
| sqlite_autoindex_document_contents_2 | UNIQUE (node_id) |
|
|
79
|
+
| sqlite_autoindex_document_contents_1 | PRIMARY KEY (content_id) |
|
|
80
|
+
|
|
81
|
+
## Relations
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: document_contents Pages: 1 -->
|
|
7
|
+
<svg width="820pt" height="730pt"
|
|
8
|
+
viewBox="0.00 0.00 820.24 729.60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 725.6)">
|
|
10
|
+
<title>document_contents</title>
|
|
11
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-725.6 816.24,-725.6 816.24,4 -4,4"/>
|
|
12
|
+
<!-- document_contents -->
|
|
13
|
+
<g id="node1" class="node">
|
|
14
|
+
<title>document_contents</title>
|
|
15
|
+
<polygon fill="#efefef" stroke="none" points="249.8,-399.4 249.8,-445.4 591.39,-445.4 591.39,-399.4 249.8,-399.4"/>
|
|
16
|
+
<polygon fill="none" stroke="black" points="249.8,-399.4 249.8,-445.4 591.39,-445.4 591.39,-399.4 249.8,-399.4"/>
|
|
17
|
+
<text text-anchor="start" x="315.98" y="-423.2" font-family="Arial Bold" font-size="18.00">document_contents</text>
|
|
18
|
+
<text text-anchor="start" x="455.95" y="-423.2" font-family="Arial" font-size="14.00"> </text>
|
|
19
|
+
<text text-anchor="start" x="487.07" y="-423.2" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
20
|
+
<text text-anchor="start" x="256.8" y="-408.8" font-family="Arial" font-size="14.00" fill="#333333">특정 document node에 붙는 block collection을 관리한다.</text>
|
|
21
|
+
<polygon fill="none" stroke="black" points="249.8,-368.6 249.8,-399.4 591.39,-399.4 591.39,-368.6 249.8,-368.6"/>
|
|
22
|
+
<text text-anchor="start" x="256.8" y="-380.8" font-family="Arial" font-size="14.00">content_id </text>
|
|
23
|
+
<text text-anchor="start" x="325.29" y="-380.8" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
24
|
+
<text text-anchor="start" x="397.64" y="-380.8" font-family="Arial" font-size="14.00"> content 식별자</text>
|
|
25
|
+
<polygon fill="none" stroke="black" points="249.8,-337.8 249.8,-368.6 591.39,-368.6 591.39,-337.8 249.8,-337.8"/>
|
|
26
|
+
<text text-anchor="start" x="256.8" y="-350" font-family="Arial" font-size="14.00">document_id </text>
|
|
27
|
+
<text text-anchor="start" x="340.85" y="-350" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
28
|
+
<text text-anchor="start" x="413.2" y="-350" font-family="Arial" font-size="14.00"> 소속 문서 식별자</text>
|
|
29
|
+
<polygon fill="none" stroke="black" points="249.8,-307 249.8,-337.8 591.39,-337.8 591.39,-307 249.8,-307"/>
|
|
30
|
+
<text text-anchor="start" x="256.8" y="-319.2" font-family="Arial" font-size="14.00">node_id </text>
|
|
31
|
+
<text text-anchor="start" x="310.51" y="-319.2" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
32
|
+
<text text-anchor="start" x="382.86" y="-319.2" font-family="Arial" font-size="14.00"> 소속 노드 식별자</text>
|
|
33
|
+
<polygon fill="none" stroke="black" stroke-width="3" points="248.3,-305.5 248.3,-446.9 592.89,-446.9 592.89,-305.5 248.3,-305.5"/>
|
|
34
|
+
</g>
|
|
35
|
+
<!-- document_documents -->
|
|
36
|
+
<g id="node3" class="node">
|
|
37
|
+
<title>document_documents</title>
|
|
38
|
+
<polygon fill="#efefef" stroke="none" points="43.2,-135.6 43.2,-181.6 383.99,-181.6 383.99,-135.6 43.2,-135.6"/>
|
|
39
|
+
<polygon fill="none" stroke="black" points="43.2,-135.6 43.2,-181.6 383.99,-181.6 383.99,-135.6 43.2,-135.6"/>
|
|
40
|
+
<text text-anchor="start" x="99.98" y="-159.4" font-family="Arial Bold" font-size="18.00">document_documents</text>
|
|
41
|
+
<text text-anchor="start" x="257.95" y="-159.4" font-family="Arial" font-size="14.00"> </text>
|
|
42
|
+
<text text-anchor="start" x="289.07" y="-159.4" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
43
|
+
<text text-anchor="start" x="52.94" y="-145" font-family="Arial" font-size="14.00" fill="#333333">문서 단위 메타데이터, 작성자, taxonomy, 상태를 관리한다.</text>
|
|
44
|
+
<polygon fill="none" stroke="black" points="43.2,-104.8 43.2,-135.6 383.99,-135.6 383.99,-104.8 43.2,-104.8"/>
|
|
45
|
+
<text text-anchor="start" x="50.2" y="-117" font-family="Arial" font-size="14.00">document_id </text>
|
|
46
|
+
<text text-anchor="start" x="134.25" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
47
|
+
<text text-anchor="start" x="206.6" y="-117" font-family="Arial" font-size="14.00"> 문서 식별자</text>
|
|
48
|
+
<polygon fill="none" stroke="black" points="43.2,-74 43.2,-104.8 383.99,-104.8 383.99,-74 43.2,-74"/>
|
|
49
|
+
<text text-anchor="start" x="50.2" y="-86.2" font-family="Arial" font-size="14.00">taxonomy_id </text>
|
|
50
|
+
<text text-anchor="start" x="133.47" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
51
|
+
<text text-anchor="start" x="205.81" y="-86.2" font-family="Arial" font-size="14.00"> 적용 taxonomy 식별자</text>
|
|
52
|
+
<polygon fill="none" stroke="black" points="43.2,-43.2 43.2,-74 383.99,-74 383.99,-43.2 43.2,-43.2"/>
|
|
53
|
+
<text text-anchor="start" x="50.2" y="-55.4" font-family="Arial" font-size="14.00">source_document_id </text>
|
|
54
|
+
<text text-anchor="start" x="184.06" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
55
|
+
<text text-anchor="start" x="256.41" y="-55.4" font-family="Arial" font-size="14.00"> 파생 원본 문서 식별자</text>
|
|
56
|
+
</g>
|
|
57
|
+
<!-- document_contents->document_documents -->
|
|
58
|
+
<g id="edge2" class="edge">
|
|
59
|
+
<title>document_contents:document_id->document_documents:document_id</title>
|
|
60
|
+
<path fill="none" stroke="black" d="M238.73,-351.69C210.97,-342.2 226.98,-290.21 249.8,-260.8 287.64,-212.01 346.17,-273.61 383.99,-224.8 412.46,-188.05 431.48,-120.2 384.99,-120.2"/>
|
|
61
|
+
<polygon fill="black" stroke="black" points="238.58,-351.67 247.8,-357.6 243.85,-352.46 248.14,-353.1 248.14,-353.1 248.14,-353.1 243.85,-352.46 249.13,-348.7 238.58,-351.67"/>
|
|
62
|
+
</g>
|
|
63
|
+
<!-- document_nodes -->
|
|
64
|
+
<g id="node4" class="node">
|
|
65
|
+
<title>document_nodes</title>
|
|
66
|
+
<polygon fill="#efefef" stroke="none" points="488.14,-135.6 488.14,-181.6 769.04,-181.6 769.04,-135.6 488.14,-135.6"/>
|
|
67
|
+
<polygon fill="none" stroke="black" points="488.14,-135.6 488.14,-181.6 769.04,-181.6 769.04,-135.6 488.14,-135.6"/>
|
|
68
|
+
<text text-anchor="start" x="532.98" y="-159.4" font-family="Arial Bold" font-size="18.00">document_nodes</text>
|
|
69
|
+
<text text-anchor="start" x="654.95" y="-159.4" font-family="Arial" font-size="14.00"> </text>
|
|
70
|
+
<text text-anchor="start" x="686.07" y="-159.4" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
71
|
+
<text text-anchor="start" x="532.89" y="-145" font-family="Arial" font-size="14.00" fill="#333333">문서의 계층 node tree를 관리한다.</text>
|
|
72
|
+
<polygon fill="none" stroke="black" points="488.14,-104.8 488.14,-135.6 769.04,-135.6 769.04,-104.8 488.14,-104.8"/>
|
|
73
|
+
<text text-anchor="start" x="495.14" y="-117" font-family="Arial" font-size="14.00">node_id </text>
|
|
74
|
+
<text text-anchor="start" x="548.86" y="-117" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
75
|
+
<text text-anchor="start" x="621.21" y="-117" font-family="Arial" font-size="14.00"> 노드 식별자</text>
|
|
76
|
+
<polygon fill="none" stroke="black" points="488.14,-74 488.14,-104.8 769.04,-104.8 769.04,-74 488.14,-74"/>
|
|
77
|
+
<text text-anchor="start" x="495.14" y="-86.2" font-family="Arial" font-size="14.00">document_id </text>
|
|
78
|
+
<text text-anchor="start" x="579.2" y="-86.2" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
79
|
+
<text text-anchor="start" x="651.54" y="-86.2" font-family="Arial" font-size="14.00"> 소속 문서 식별자</text>
|
|
80
|
+
<polygon fill="none" stroke="black" points="488.14,-43.2 488.14,-74 769.04,-74 769.04,-43.2 488.14,-43.2"/>
|
|
81
|
+
<text text-anchor="start" x="495.14" y="-55.4" font-family="Arial" font-size="14.00">parent_node_id </text>
|
|
82
|
+
<text text-anchor="start" x="596.34" y="-55.4" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
83
|
+
<text text-anchor="start" x="668.69" y="-55.4" font-family="Arial" font-size="14.00"> 상위 노드 식별자</text>
|
|
84
|
+
</g>
|
|
85
|
+
<!-- document_contents->document_nodes -->
|
|
86
|
+
<g id="edge3" class="edge">
|
|
87
|
+
<title>document_contents:node_id->document_nodes:node_id</title>
|
|
88
|
+
<path fill="none" stroke="black" d="M602.45,-319.73C615.82,-310.51 604.92,-279.53 591.39,-260.8 562.93,-221.41 516.48,-264.28 488.14,-224.8 461.04,-187.03 440.65,-120.2 487.14,-120.2"/>
|
|
89
|
+
<polygon fill="black" stroke="black" points="602.38,-319.75 591.56,-317.96 597.22,-321.12 593.04,-322.23 593.04,-322.23 593.04,-322.23 597.22,-321.12 593.87,-326.66 602.38,-319.75"/>
|
|
90
|
+
</g>
|
|
91
|
+
<!-- document_blocks -->
|
|
92
|
+
<g id="node2" class="node">
|
|
93
|
+
<title>document_blocks</title>
|
|
94
|
+
<polygon fill="#efefef" stroke="none" points="285.2,-632.4 285.2,-678.4 555.98,-678.4 555.98,-632.4 285.2,-632.4"/>
|
|
95
|
+
<polygon fill="none" stroke="black" points="285.2,-632.4 285.2,-678.4 555.98,-678.4 555.98,-632.4 285.2,-632.4"/>
|
|
96
|
+
<text text-anchor="start" x="322.48" y="-656.2" font-family="Arial Bold" font-size="18.00">document_blocks</text>
|
|
97
|
+
<text text-anchor="start" x="449.45" y="-656.2" font-family="Arial" font-size="14.00"> </text>
|
|
98
|
+
<text text-anchor="start" x="480.57" y="-656.2" font-family="Arial" font-size="14.00" fill="#666666">[table]</text>
|
|
99
|
+
<text text-anchor="start" x="330.35" y="-641.8" font-family="Arial" font-size="14.00" fill="#333333">문서 본문 표현 block을 관리한다.</text>
|
|
100
|
+
<polygon fill="none" stroke="black" points="285.2,-601.6 285.2,-632.4 555.98,-632.4 555.98,-601.6 285.2,-601.6"/>
|
|
101
|
+
<text text-anchor="start" x="292.2" y="-613.8" font-family="Arial" font-size="14.00">block_id </text>
|
|
102
|
+
<text text-anchor="start" x="347.46" y="-613.8" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
103
|
+
<text text-anchor="start" x="419.8" y="-613.8" font-family="Arial" font-size="14.00"> block 식별자</text>
|
|
104
|
+
<polygon fill="none" stroke="black" points="285.2,-570.8 285.2,-601.6 555.98,-601.6 555.98,-570.8 285.2,-570.8"/>
|
|
105
|
+
<text text-anchor="start" x="292.2" y="-583" font-family="Arial" font-size="14.00">content_id </text>
|
|
106
|
+
<text text-anchor="start" x="360.7" y="-583" font-family="Arial" font-size="14.00" fill="#666666">[CHAR(36)]</text>
|
|
107
|
+
<text text-anchor="start" x="433.04" y="-583" font-family="Arial" font-size="14.00"> 소속 content 식별자</text>
|
|
108
|
+
</g>
|
|
109
|
+
<!-- document_blocks->document_contents -->
|
|
110
|
+
<g id="edge1" class="edge">
|
|
111
|
+
<title>document_blocks:content_id->document_contents:content_id</title>
|
|
112
|
+
<path fill="none" stroke="black" d="M421.33,-559.48C431.69,-492.79 548,-558.5 591.39,-491.6 617.41,-451.48 640.21,-384 592.39,-384"/>
|
|
113
|
+
<polygon fill="black" stroke="black" points="421.33,-559.49 416.13,-569.14 420.95,-564.81 420.64,-569.13 420.64,-569.13 420.64,-569.13 420.95,-564.81 425.1,-569.79 421.33,-559.49"/>
|
|
114
|
+
</g>
|
|
115
|
+
</g>
|
|
116
|
+
</svg>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# document_documents
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
문서 단위 메타데이터, 작성자, taxonomy, 상태를 관리한다.
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary><strong>Table Definition</strong></summary>
|
|
9
|
+
|
|
10
|
+
```sql
|
|
11
|
+
CREATE TABLE document_documents (
|
|
12
|
+
-- 문서 식별자
|
|
13
|
+
document_id CHAR(36) PRIMARY KEY
|
|
14
|
+
CHECK (length(document_id) = 36),
|
|
15
|
+
|
|
16
|
+
-- 문서 유형 코드
|
|
17
|
+
document_type_code VARCHAR(128) NOT NULL,
|
|
18
|
+
|
|
19
|
+
-- 적용 taxonomy 식별자
|
|
20
|
+
taxonomy_id CHAR(36) NOT NULL
|
|
21
|
+
CHECK (length(taxonomy_id) = 36),
|
|
22
|
+
|
|
23
|
+
-- 문서 제목
|
|
24
|
+
title VARCHAR(512) NOT NULL,
|
|
25
|
+
|
|
26
|
+
-- 파생 원본 문서 식별자
|
|
27
|
+
source_document_id CHAR(36)
|
|
28
|
+
CHECK (source_document_id IS NULL OR length(source_document_id) = 36),
|
|
29
|
+
|
|
30
|
+
-- 표시 버전
|
|
31
|
+
version_label VARCHAR(64),
|
|
32
|
+
|
|
33
|
+
-- 작성자 유형
|
|
34
|
+
author_type_code VARCHAR(32) NOT NULL DEFAULT 'user'
|
|
35
|
+
CHECK (author_type_code IN ('user', 'agent', 'system')),
|
|
36
|
+
|
|
37
|
+
-- 작성자 식별자
|
|
38
|
+
author_id VARCHAR(128),
|
|
39
|
+
|
|
40
|
+
-- 작성자 표시명
|
|
41
|
+
author_name VARCHAR(128),
|
|
42
|
+
|
|
43
|
+
-- 문서 상태
|
|
44
|
+
status_code VARCHAR(32) NOT NULL DEFAULT 'draft'
|
|
45
|
+
CHECK (status_code IN ('draft', 'in_review', 'approved', 'published', 'archived')),
|
|
46
|
+
|
|
47
|
+
-- TOC로 취급할 level limit
|
|
48
|
+
toc_level_limit INTEGER NOT NULL DEFAULT 3
|
|
49
|
+
CHECK (toc_level_limit >= 1),
|
|
50
|
+
|
|
51
|
+
-- published 상태 전환 시각
|
|
52
|
+
published_at DATETIME,
|
|
53
|
+
|
|
54
|
+
-- 생성 시각
|
|
55
|
+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
56
|
+
|
|
57
|
+
-- 수정 시각
|
|
58
|
+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
59
|
+
|
|
60
|
+
-- 확장 메타데이터
|
|
61
|
+
metadata_json JSON
|
|
62
|
+
CHECK (metadata_json IS NULL OR json_valid(metadata_json)),
|
|
63
|
+
|
|
64
|
+
FOREIGN KEY (taxonomy_id)
|
|
65
|
+
REFERENCES document_node_taxonomies (taxonomy_id),
|
|
66
|
+
|
|
67
|
+
FOREIGN KEY (source_document_id)
|
|
68
|
+
REFERENCES document_documents (document_id)
|
|
69
|
+
ON DELETE SET NULL
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
</details>
|
|
74
|
+
|
|
75
|
+
## Columns
|
|
76
|
+
|
|
77
|
+
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
|
78
|
+
| ------------------ | ------------ | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------ |
|
|
79
|
+
| document_id | CHAR(36) | | true | [document_documents](document_documents.md) [document_nodes](document_nodes.md) [document_contents](document_contents.md) [document_annotations](document_annotations.md) [document_revisions](document_revisions.md) [document_change_events](document_change_events.md) [document_versions](document_versions.md) | | 문서 식별자 |
|
|
80
|
+
| document_type_code | VARCHAR(128) | | false | | | 문서 유형 코드 |
|
|
81
|
+
| taxonomy_id | CHAR(36) | | false | | [document_node_taxonomies](document_node_taxonomies.md) | 적용 taxonomy 식별자 |
|
|
82
|
+
| title | VARCHAR(512) | | false | | | 문서 제목 |
|
|
83
|
+
| source_document_id | CHAR(36) | | true | | [document_documents](document_documents.md) | 파생 원본 문서 식별자 |
|
|
84
|
+
| version_label | VARCHAR(64) | | true | | | 표시 버전 |
|
|
85
|
+
| author_type_code | VARCHAR(32) | 'user' | false | | | 작성자 유형 |
|
|
86
|
+
| author_id | VARCHAR(128) | | true | | | 작성자 식별자 |
|
|
87
|
+
| author_name | VARCHAR(128) | | true | | | 작성자 표시명 |
|
|
88
|
+
| status_code | VARCHAR(32) | 'draft' | false | | | 문서 상태 |
|
|
89
|
+
| toc_level_limit | INTEGER | 3 | false | | | TOC로 취급할 level limit |
|
|
90
|
+
| published_at | DATETIME | | true | | | published 상태 전환 시각 |
|
|
91
|
+
| created_at | DATETIME | CURRENT_TIMESTAMP | false | | | 생성 시각 |
|
|
92
|
+
| updated_at | DATETIME | CURRENT_TIMESTAMP | false | | | 수정 시각 |
|
|
93
|
+
| metadata_json | JSON | | true | | | 확장 메타데이터 |
|
|
94
|
+
|
|
95
|
+
## Constraints
|
|
96
|
+
|
|
97
|
+
| Name | Type | Definition |
|
|
98
|
+
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| document_id | PRIMARY KEY | PRIMARY KEY (document_id) |
|
|
100
|
+
| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (source_document_id) REFERENCES document_documents (document_id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE |
|
|
101
|
+
| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (taxonomy_id) REFERENCES document_node_taxonomies (taxonomy_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
|
|
102
|
+
| sqlite_autoindex_document_documents_1 | PRIMARY KEY | PRIMARY KEY (document_id) |
|
|
103
|
+
| - | CHECK | CHECK (length(document_id) = 36) |
|
|
104
|
+
| - | CHECK | CHECK (length(taxonomy_id) = 36) |
|
|
105
|
+
| - | CHECK | CHECK (source_document_id IS NULL OR length(source_document_id) = 36) |
|
|
106
|
+
| - | CHECK | CHECK (author_type_code IN ('user', 'agent', 'system')) |
|
|
107
|
+
| - | CHECK | CHECK (status_code IN ('draft', 'in_review', 'approved', 'published', 'archived')) |
|
|
108
|
+
| - | CHECK | CHECK (toc_level_limit >= 1) |
|
|
109
|
+
| - | CHECK | CHECK (metadata_json IS NULL OR json_valid(metadata_json)) |
|
|
110
|
+
|
|
111
|
+
## Indexes
|
|
112
|
+
|
|
113
|
+
| Name | Definition |
|
|
114
|
+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| idx_document_documents_source | CREATE INDEX idx_document_documents_source<br /> ON document_documents (source_document_id) |
|
|
116
|
+
| idx_document_documents_taxonomy | CREATE INDEX idx_document_documents_taxonomy<br /> ON document_documents (taxonomy_id) |
|
|
117
|
+
| idx_document_documents_type_status | CREATE INDEX idx_document_documents_type_status<br /> ON document_documents (document_type_code, status_code) |
|
|
118
|
+
| sqlite_autoindex_document_documents_1 | PRIMARY KEY (document_id) |
|
|
119
|
+
|
|
120
|
+
## Relations
|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
> Generated by [tbls](https://github.com/k1LoW/tbls)
|