@soddong/agentic-domain-artifact 0.7.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.
Files changed (63) hide show
  1. package/.tbls.yml +46 -0
  2. package/CHANGELOG.md +53 -0
  3. package/README.md +254 -0
  4. package/dist/database.d.ts +8 -0
  5. package/dist/database.d.ts.map +1 -0
  6. package/dist/database.js +76 -0
  7. package/dist/database.js.map +1 -0
  8. package/dist/fixtures.d.ts +7 -0
  9. package/dist/fixtures.d.ts.map +1 -0
  10. package/dist/fixtures.js +88 -0
  11. package/dist/fixtures.js.map +1 -0
  12. package/dist/index.d.ts +26 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +18 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/repositories.d.ts +29 -0
  17. package/dist/repositories.d.ts.map +1 -0
  18. package/dist/repositories.js +305 -0
  19. package/dist/repositories.js.map +1 -0
  20. package/dist/seed-apply.d.ts +22 -0
  21. package/dist/seed-apply.d.ts.map +1 -0
  22. package/dist/seed-apply.js +150 -0
  23. package/dist/seed-apply.js.map +1 -0
  24. package/dist/service.d.ts +32 -0
  25. package/dist/service.d.ts.map +1 -0
  26. package/dist/service.js +282 -0
  27. package/dist/service.js.map +1 -0
  28. package/dist/types.d.ts +264 -0
  29. package/dist/types.d.ts.map +1 -0
  30. package/dist/types.js +2 -0
  31. package/dist/types.js.map +1 -0
  32. package/docs/build.md +19 -0
  33. package/docs/configuration.md +27 -0
  34. package/docs/delivery.md +22 -0
  35. package/docs/operations.md +27 -0
  36. package/docs/publishing.md +29 -0
  37. package/docs/schema/generated/README.md +28 -0
  38. package/docs/schema/generated/artifact_code_groups.md +57 -0
  39. package/docs/schema/generated/artifact_code_groups.svg +49 -0
  40. package/docs/schema/generated/artifact_codes.md +71 -0
  41. package/docs/schema/generated/artifact_codes.svg +49 -0
  42. package/docs/schema/generated/artifact_component_instances.md +79 -0
  43. package/docs/schema/generated/artifact_component_instances.svg +177 -0
  44. package/docs/schema/generated/artifact_instances.md +79 -0
  45. package/docs/schema/generated/artifact_instances.svg +177 -0
  46. package/docs/schema/generated/artifact_resource_links.md +89 -0
  47. package/docs/schema/generated/artifact_resource_links.svg +74 -0
  48. package/docs/schema/generated/artifact_review_decision_refs.md +89 -0
  49. package/docs/schema/generated/artifact_review_decision_refs.svg +102 -0
  50. package/docs/schema/generated/artifact_schema_migrations.md +47 -0
  51. package/docs/schema/generated/artifact_schema_migrations.svg +27 -0
  52. package/docs/schema/generated/artifact_status_events.md +96 -0
  53. package/docs/schema/generated/artifact_status_events.svg +102 -0
  54. package/docs/schema/generated/artifact_trace_links.md +93 -0
  55. package/docs/schema/generated/artifact_trace_links.svg +74 -0
  56. package/docs/schema/generated/artifact_validation_result_refs.md +82 -0
  57. package/docs/schema/generated/artifact_validation_result_refs.svg +74 -0
  58. package/docs/schema/generated/schema.json +1799 -0
  59. package/docs/schema/generated/schema.mmd +132 -0
  60. package/docs/schema/generated/schema.svg +260 -0
  61. package/docs/usage.md +190 -0
  62. package/package.json +28 -0
  63. package/src/database/migrations/0001_artifact_base.sql +345 -0
@@ -0,0 +1,1799 @@
1
+ {
2
+ "name": "agentic-domain-artifact",
3
+ "desc": "Agentic Platform artifact instance domain database.",
4
+ "tables": [
5
+ {
6
+ "name": "artifact_schema_migrations",
7
+ "type": "table",
8
+ "comment": "artifact 패키지의 migration 적용 이력을 관리한다.",
9
+ "columns": [
10
+ {
11
+ "name": "migration_id",
12
+ "type": "VARCHAR(128)",
13
+ "nullable": true
14
+ },
15
+ {
16
+ "name": "migration_name",
17
+ "type": "VARCHAR(256)",
18
+ "nullable": false
19
+ },
20
+ {
21
+ "name": "applied_at",
22
+ "type": "DATETIME",
23
+ "nullable": false,
24
+ "default": "CURRENT_TIMESTAMP"
25
+ }
26
+ ],
27
+ "indexes": [
28
+ {
29
+ "name": "sqlite_autoindex_artifact_schema_migrations_1",
30
+ "def": "PRIMARY KEY (migration_id)",
31
+ "table": "artifact_schema_migrations",
32
+ "columns": [
33
+ "migration_id"
34
+ ]
35
+ }
36
+ ],
37
+ "constraints": [
38
+ {
39
+ "name": "migration_id",
40
+ "type": "PRIMARY KEY",
41
+ "def": "PRIMARY KEY (migration_id)",
42
+ "table": "artifact_schema_migrations",
43
+ "columns": [
44
+ "migration_id"
45
+ ]
46
+ },
47
+ {
48
+ "name": "sqlite_autoindex_artifact_schema_migrations_1",
49
+ "type": "PRIMARY KEY",
50
+ "def": "PRIMARY KEY (migration_id)",
51
+ "table": "artifact_schema_migrations",
52
+ "columns": [
53
+ "migration_id"
54
+ ]
55
+ }
56
+ ],
57
+ "def": "CREATE TABLE artifact_schema_migrations (\n migration_id VARCHAR(128) PRIMARY KEY,\n migration_name VARCHAR(256) NOT NULL,\n applied_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP\n)"
58
+ },
59
+ {
60
+ "name": "artifact_code_groups",
61
+ "type": "table",
62
+ "comment": "코드 그룹을 정의한다.",
63
+ "columns": [
64
+ {
65
+ "name": "code_group_code",
66
+ "type": "VARCHAR(64)",
67
+ "nullable": true
68
+ },
69
+ {
70
+ "name": "code_group_name",
71
+ "type": "VARCHAR(128)",
72
+ "nullable": false
73
+ },
74
+ {
75
+ "name": "description",
76
+ "type": "TEXT",
77
+ "nullable": true
78
+ },
79
+ {
80
+ "name": "sort_order",
81
+ "type": "INTEGER",
82
+ "nullable": false,
83
+ "default": "0"
84
+ },
85
+ {
86
+ "name": "is_active",
87
+ "type": "INTEGER",
88
+ "nullable": false,
89
+ "default": "1"
90
+ },
91
+ {
92
+ "name": "created_at",
93
+ "type": "DATETIME",
94
+ "nullable": false,
95
+ "default": "CURRENT_TIMESTAMP"
96
+ },
97
+ {
98
+ "name": "updated_at",
99
+ "type": "DATETIME",
100
+ "nullable": false,
101
+ "default": "CURRENT_TIMESTAMP"
102
+ }
103
+ ],
104
+ "indexes": [
105
+ {
106
+ "name": "sqlite_autoindex_artifact_code_groups_1",
107
+ "def": "PRIMARY KEY (code_group_code)",
108
+ "table": "artifact_code_groups",
109
+ "columns": [
110
+ "code_group_code"
111
+ ]
112
+ }
113
+ ],
114
+ "constraints": [
115
+ {
116
+ "name": "code_group_code",
117
+ "type": "PRIMARY KEY",
118
+ "def": "PRIMARY KEY (code_group_code)",
119
+ "table": "artifact_code_groups",
120
+ "columns": [
121
+ "code_group_code"
122
+ ]
123
+ },
124
+ {
125
+ "name": "sqlite_autoindex_artifact_code_groups_1",
126
+ "type": "PRIMARY KEY",
127
+ "def": "PRIMARY KEY (code_group_code)",
128
+ "table": "artifact_code_groups",
129
+ "columns": [
130
+ "code_group_code"
131
+ ]
132
+ },
133
+ {
134
+ "name": "-",
135
+ "type": "CHECK",
136
+ "def": "CHECK (is_active IN (0, 1))",
137
+ "table": "artifact_code_groups",
138
+ "columns": [
139
+ "is_active"
140
+ ]
141
+ }
142
+ ],
143
+ "def": "CREATE TABLE artifact_code_groups (\n code_group_code VARCHAR(64) PRIMARY KEY,\n code_group_name VARCHAR(128) NOT NULL,\n description TEXT,\n sort_order INTEGER NOT NULL DEFAULT 0,\n is_active INTEGER NOT NULL DEFAULT 1\n CHECK (is_active IN (0, 1)),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP\n)"
144
+ },
145
+ {
146
+ "name": "artifact_codes",
147
+ "type": "table",
148
+ "comment": "코드 그룹별 코드 값을 정의한다.",
149
+ "columns": [
150
+ {
151
+ "name": "code_group_code",
152
+ "type": "VARCHAR(64)",
153
+ "nullable": false
154
+ },
155
+ {
156
+ "name": "code",
157
+ "type": "VARCHAR(128)",
158
+ "nullable": false
159
+ },
160
+ {
161
+ "name": "code_name",
162
+ "type": "VARCHAR(128)",
163
+ "nullable": false
164
+ },
165
+ {
166
+ "name": "description",
167
+ "type": "TEXT",
168
+ "nullable": true
169
+ },
170
+ {
171
+ "name": "sort_order",
172
+ "type": "INTEGER",
173
+ "nullable": false,
174
+ "default": "0"
175
+ },
176
+ {
177
+ "name": "is_active",
178
+ "type": "INTEGER",
179
+ "nullable": false,
180
+ "default": "1"
181
+ },
182
+ {
183
+ "name": "metadata_json",
184
+ "type": "JSON",
185
+ "nullable": true
186
+ },
187
+ {
188
+ "name": "created_at",
189
+ "type": "DATETIME",
190
+ "nullable": false,
191
+ "default": "CURRENT_TIMESTAMP"
192
+ },
193
+ {
194
+ "name": "updated_at",
195
+ "type": "DATETIME",
196
+ "nullable": false,
197
+ "default": "CURRENT_TIMESTAMP"
198
+ }
199
+ ],
200
+ "indexes": [
201
+ {
202
+ "name": "sqlite_autoindex_artifact_codes_1",
203
+ "def": "PRIMARY KEY (code_group_code, code)",
204
+ "table": "artifact_codes",
205
+ "columns": [
206
+ "code_group_code",
207
+ "code"
208
+ ]
209
+ }
210
+ ],
211
+ "constraints": [
212
+ {
213
+ "name": "code_group_code",
214
+ "type": "PRIMARY KEY",
215
+ "def": "PRIMARY KEY (code_group_code)",
216
+ "table": "artifact_codes",
217
+ "columns": [
218
+ "code_group_code"
219
+ ]
220
+ },
221
+ {
222
+ "name": "code",
223
+ "type": "PRIMARY KEY",
224
+ "def": "PRIMARY KEY (code)",
225
+ "table": "artifact_codes",
226
+ "columns": [
227
+ "code"
228
+ ]
229
+ },
230
+ {
231
+ "name": "- (Foreign key ID: 0)",
232
+ "type": "FOREIGN KEY",
233
+ "def": "FOREIGN KEY (code_group_code) REFERENCES artifact_code_groups (code_group_code) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
234
+ "table": "artifact_codes",
235
+ "referenced_table": "artifact_code_groups",
236
+ "columns": [
237
+ "code_group_code"
238
+ ],
239
+ "referenced_columns": [
240
+ "code_group_code"
241
+ ]
242
+ },
243
+ {
244
+ "name": "sqlite_autoindex_artifact_codes_1",
245
+ "type": "PRIMARY KEY",
246
+ "def": "PRIMARY KEY (code_group_code, code)",
247
+ "table": "artifact_codes",
248
+ "columns": [
249
+ "code_group_code",
250
+ "code"
251
+ ]
252
+ },
253
+ {
254
+ "name": "-",
255
+ "type": "CHECK",
256
+ "def": "CHECK (is_active IN (0, 1))",
257
+ "table": "artifact_codes",
258
+ "columns": [
259
+ "is_active"
260
+ ]
261
+ },
262
+ {
263
+ "name": "-",
264
+ "type": "CHECK",
265
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
266
+ "table": "artifact_codes",
267
+ "columns": [
268
+ "metadata_json"
269
+ ]
270
+ }
271
+ ],
272
+ "def": "CREATE TABLE artifact_codes (\n code_group_code VARCHAR(64) NOT NULL,\n code VARCHAR(128) NOT NULL,\n code_name VARCHAR(128) NOT NULL,\n description TEXT,\n sort_order INTEGER NOT NULL DEFAULT 0,\n is_active INTEGER NOT NULL DEFAULT 1\n CHECK (is_active IN (0, 1)),\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\n PRIMARY KEY (code_group_code, code),\n\n FOREIGN KEY (code_group_code)\n REFERENCES artifact_code_groups (code_group_code)\n ON DELETE CASCADE\n)"
273
+ },
274
+ {
275
+ "name": "artifact_instances",
276
+ "type": "table",
277
+ "comment": "실제 산출물 instance를 관리한다.",
278
+ "columns": [
279
+ {
280
+ "name": "artifact_instance_id",
281
+ "type": "CHAR(36)",
282
+ "nullable": true
283
+ },
284
+ {
285
+ "name": "artifact_code",
286
+ "type": "VARCHAR(128)",
287
+ "nullable": false
288
+ },
289
+ {
290
+ "name": "artifact_name",
291
+ "type": "VARCHAR(256)",
292
+ "nullable": false
293
+ },
294
+ {
295
+ "name": "artifact_version",
296
+ "type": "VARCHAR(64)",
297
+ "nullable": false,
298
+ "default": "'0.1.0'"
299
+ },
300
+ {
301
+ "name": "artifact_standard_code",
302
+ "type": "VARCHAR(128)",
303
+ "nullable": false
304
+ },
305
+ {
306
+ "name": "artifact_standard_version",
307
+ "type": "VARCHAR(64)",
308
+ "nullable": false
309
+ },
310
+ {
311
+ "name": "artifact_status_code",
312
+ "type": "VARCHAR(64)",
313
+ "nullable": false,
314
+ "default": "'draft'"
315
+ },
316
+ {
317
+ "name": "methodology_activity_id",
318
+ "type": "CHAR(36)",
319
+ "nullable": true
320
+ },
321
+ {
322
+ "name": "owner_role_code",
323
+ "type": "VARCHAR(128)",
324
+ "nullable": true
325
+ },
326
+ {
327
+ "name": "created_at",
328
+ "type": "DATETIME",
329
+ "nullable": false,
330
+ "default": "CURRENT_TIMESTAMP"
331
+ },
332
+ {
333
+ "name": "updated_at",
334
+ "type": "DATETIME",
335
+ "nullable": false,
336
+ "default": "CURRENT_TIMESTAMP"
337
+ },
338
+ {
339
+ "name": "metadata_json",
340
+ "type": "JSON",
341
+ "nullable": true
342
+ }
343
+ ],
344
+ "indexes": [
345
+ {
346
+ "name": "idx_artifact_instances_status",
347
+ "def": "CREATE INDEX idx_artifact_instances_status\n ON artifact_instances (artifact_status_code)",
348
+ "table": "artifact_instances",
349
+ "columns": [
350
+ "artifact_status_code"
351
+ ]
352
+ },
353
+ {
354
+ "name": "idx_artifact_instances_standard",
355
+ "def": "CREATE INDEX idx_artifact_instances_standard\n ON artifact_instances (artifact_standard_code, artifact_standard_version)",
356
+ "table": "artifact_instances",
357
+ "columns": [
358
+ "artifact_standard_code",
359
+ "artifact_standard_version"
360
+ ]
361
+ },
362
+ {
363
+ "name": "sqlite_autoindex_artifact_instances_2",
364
+ "def": "UNIQUE (artifact_code, artifact_version)",
365
+ "table": "artifact_instances",
366
+ "columns": [
367
+ "artifact_code",
368
+ "artifact_version"
369
+ ]
370
+ },
371
+ {
372
+ "name": "sqlite_autoindex_artifact_instances_1",
373
+ "def": "PRIMARY KEY (artifact_instance_id)",
374
+ "table": "artifact_instances",
375
+ "columns": [
376
+ "artifact_instance_id"
377
+ ]
378
+ }
379
+ ],
380
+ "constraints": [
381
+ {
382
+ "name": "artifact_instance_id",
383
+ "type": "PRIMARY KEY",
384
+ "def": "PRIMARY KEY (artifact_instance_id)",
385
+ "table": "artifact_instances",
386
+ "columns": [
387
+ "artifact_instance_id"
388
+ ]
389
+ },
390
+ {
391
+ "name": "sqlite_autoindex_artifact_instances_2",
392
+ "type": "UNIQUE",
393
+ "def": "UNIQUE (artifact_code, artifact_version)",
394
+ "table": "artifact_instances",
395
+ "columns": [
396
+ "artifact_code",
397
+ "artifact_version"
398
+ ]
399
+ },
400
+ {
401
+ "name": "sqlite_autoindex_artifact_instances_1",
402
+ "type": "PRIMARY KEY",
403
+ "def": "PRIMARY KEY (artifact_instance_id)",
404
+ "table": "artifact_instances",
405
+ "columns": [
406
+ "artifact_instance_id"
407
+ ]
408
+ },
409
+ {
410
+ "name": "-",
411
+ "type": "CHECK",
412
+ "def": "CHECK (length(artifact_instance_id) = 36)",
413
+ "table": "artifact_instances",
414
+ "columns": [
415
+ "artifact_instance_id"
416
+ ]
417
+ },
418
+ {
419
+ "name": "-",
420
+ "type": "CHECK",
421
+ "def": "CHECK (artifact_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated'))",
422
+ "table": "artifact_instances",
423
+ "columns": [
424
+ "artifact_status_code"
425
+ ]
426
+ },
427
+ {
428
+ "name": "-",
429
+ "type": "CHECK",
430
+ "def": "CHECK (methodology_activity_id IS NULL OR length(methodology_activity_id) = 36)",
431
+ "table": "artifact_instances",
432
+ "columns": [
433
+ "methodology_activity_id"
434
+ ]
435
+ },
436
+ {
437
+ "name": "-",
438
+ "type": "CHECK",
439
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
440
+ "table": "artifact_instances",
441
+ "columns": [
442
+ "metadata_json"
443
+ ]
444
+ }
445
+ ],
446
+ "def": "CREATE TABLE artifact_instances (\n artifact_instance_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_instance_id) = 36),\n artifact_code VARCHAR(128) NOT NULL,\n artifact_name VARCHAR(256) NOT NULL,\n artifact_version VARCHAR(64) NOT NULL DEFAULT '0.1.0',\n artifact_standard_code VARCHAR(128) NOT NULL,\n artifact_standard_version VARCHAR(64) NOT NULL,\n artifact_status_code VARCHAR(64) NOT NULL DEFAULT 'draft'\n CHECK (artifact_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated')),\n methodology_activity_id CHAR(36)\n CHECK (methodology_activity_id IS NULL OR length(methodology_activity_id) = 36),\n owner_role_code VARCHAR(128),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n UNIQUE (artifact_code, artifact_version)\n)"
447
+ },
448
+ {
449
+ "name": "artifact_component_instances",
450
+ "type": "table",
451
+ "comment": "실제 산출물 안의 본문, 부록 등 component instance를 관리한다.",
452
+ "columns": [
453
+ {
454
+ "name": "artifact_component_instance_id",
455
+ "type": "CHAR(36)",
456
+ "nullable": true
457
+ },
458
+ {
459
+ "name": "artifact_instance_id",
460
+ "type": "CHAR(36)",
461
+ "nullable": false
462
+ },
463
+ {
464
+ "name": "artifact_component_code",
465
+ "type": "VARCHAR(128)",
466
+ "nullable": false
467
+ },
468
+ {
469
+ "name": "artifact_component_role_code",
470
+ "type": "VARCHAR(64)",
471
+ "nullable": true
472
+ },
473
+ {
474
+ "name": "component_instance_name",
475
+ "type": "VARCHAR(256)",
476
+ "nullable": false
477
+ },
478
+ {
479
+ "name": "component_status_code",
480
+ "type": "VARCHAR(64)",
481
+ "nullable": false,
482
+ "default": "'draft'"
483
+ },
484
+ {
485
+ "name": "sort_order",
486
+ "type": "INTEGER",
487
+ "nullable": false,
488
+ "default": "0"
489
+ },
490
+ {
491
+ "name": "created_at",
492
+ "type": "DATETIME",
493
+ "nullable": false,
494
+ "default": "CURRENT_TIMESTAMP"
495
+ },
496
+ {
497
+ "name": "updated_at",
498
+ "type": "DATETIME",
499
+ "nullable": false,
500
+ "default": "CURRENT_TIMESTAMP"
501
+ },
502
+ {
503
+ "name": "metadata_json",
504
+ "type": "JSON",
505
+ "nullable": true
506
+ }
507
+ ],
508
+ "indexes": [
509
+ {
510
+ "name": "idx_artifact_component_instances_artifact",
511
+ "def": "CREATE INDEX idx_artifact_component_instances_artifact\n ON artifact_component_instances (artifact_instance_id)",
512
+ "table": "artifact_component_instances",
513
+ "columns": [
514
+ "artifact_instance_id"
515
+ ]
516
+ },
517
+ {
518
+ "name": "sqlite_autoindex_artifact_component_instances_2",
519
+ "def": "UNIQUE (artifact_instance_id, artifact_component_code)",
520
+ "table": "artifact_component_instances",
521
+ "columns": [
522
+ "artifact_instance_id",
523
+ "artifact_component_code"
524
+ ]
525
+ },
526
+ {
527
+ "name": "sqlite_autoindex_artifact_component_instances_1",
528
+ "def": "PRIMARY KEY (artifact_component_instance_id)",
529
+ "table": "artifact_component_instances",
530
+ "columns": [
531
+ "artifact_component_instance_id"
532
+ ]
533
+ }
534
+ ],
535
+ "constraints": [
536
+ {
537
+ "name": "artifact_component_instance_id",
538
+ "type": "PRIMARY KEY",
539
+ "def": "PRIMARY KEY (artifact_component_instance_id)",
540
+ "table": "artifact_component_instances",
541
+ "columns": [
542
+ "artifact_component_instance_id"
543
+ ]
544
+ },
545
+ {
546
+ "name": "- (Foreign key ID: 0)",
547
+ "type": "FOREIGN KEY",
548
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
549
+ "table": "artifact_component_instances",
550
+ "referenced_table": "artifact_instances",
551
+ "columns": [
552
+ "artifact_instance_id"
553
+ ],
554
+ "referenced_columns": [
555
+ "artifact_instance_id"
556
+ ]
557
+ },
558
+ {
559
+ "name": "sqlite_autoindex_artifact_component_instances_2",
560
+ "type": "UNIQUE",
561
+ "def": "UNIQUE (artifact_instance_id, artifact_component_code)",
562
+ "table": "artifact_component_instances",
563
+ "columns": [
564
+ "artifact_instance_id",
565
+ "artifact_component_code"
566
+ ]
567
+ },
568
+ {
569
+ "name": "sqlite_autoindex_artifact_component_instances_1",
570
+ "type": "PRIMARY KEY",
571
+ "def": "PRIMARY KEY (artifact_component_instance_id)",
572
+ "table": "artifact_component_instances",
573
+ "columns": [
574
+ "artifact_component_instance_id"
575
+ ]
576
+ },
577
+ {
578
+ "name": "-",
579
+ "type": "CHECK",
580
+ "def": "CHECK (length(artifact_component_instance_id) = 36)",
581
+ "table": "artifact_component_instances",
582
+ "columns": [
583
+ "artifact_component_instance_id"
584
+ ]
585
+ },
586
+ {
587
+ "name": "-",
588
+ "type": "CHECK",
589
+ "def": "CHECK (length(artifact_instance_id) = 36)",
590
+ "table": "artifact_component_instances",
591
+ "columns": [
592
+ "artifact_instance_id"
593
+ ]
594
+ },
595
+ {
596
+ "name": "-",
597
+ "type": "CHECK",
598
+ "def": "CHECK (component_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated'))",
599
+ "table": "artifact_component_instances",
600
+ "columns": [
601
+ "component_status_code"
602
+ ]
603
+ },
604
+ {
605
+ "name": "-",
606
+ "type": "CHECK",
607
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
608
+ "table": "artifact_component_instances",
609
+ "columns": [
610
+ "metadata_json"
611
+ ]
612
+ }
613
+ ],
614
+ "def": "CREATE TABLE artifact_component_instances (\n artifact_component_instance_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_component_instance_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_code VARCHAR(128) NOT NULL,\n artifact_component_role_code VARCHAR(64),\n component_instance_name VARCHAR(256) NOT NULL,\n component_status_code VARCHAR(64) NOT NULL DEFAULT 'draft'\n CHECK (component_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated')),\n sort_order INTEGER NOT NULL DEFAULT 0,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n UNIQUE (artifact_instance_id, artifact_component_code)\n)"
615
+ },
616
+ {
617
+ "name": "artifact_resource_links",
618
+ "type": "table",
619
+ "comment": "산출물 instance 또는 component instance와 document/file/resource를 연결한다.",
620
+ "columns": [
621
+ {
622
+ "name": "artifact_resource_link_id",
623
+ "type": "CHAR(36)",
624
+ "nullable": true
625
+ },
626
+ {
627
+ "name": "artifact_instance_id",
628
+ "type": "CHAR(36)",
629
+ "nullable": false
630
+ },
631
+ {
632
+ "name": "artifact_component_instance_id",
633
+ "type": "CHAR(36)",
634
+ "nullable": true
635
+ },
636
+ {
637
+ "name": "resource_type_code",
638
+ "type": "VARCHAR(64)",
639
+ "nullable": false
640
+ },
641
+ {
642
+ "name": "resource_ref",
643
+ "type": "VARCHAR(1024)",
644
+ "nullable": false
645
+ },
646
+ {
647
+ "name": "resource_role_code",
648
+ "type": "VARCHAR(64)",
649
+ "nullable": false,
650
+ "default": "'CONTENT'"
651
+ },
652
+ {
653
+ "name": "is_primary",
654
+ "type": "INTEGER",
655
+ "nullable": false,
656
+ "default": "0"
657
+ },
658
+ {
659
+ "name": "created_at",
660
+ "type": "DATETIME",
661
+ "nullable": false,
662
+ "default": "CURRENT_TIMESTAMP"
663
+ },
664
+ {
665
+ "name": "updated_at",
666
+ "type": "DATETIME",
667
+ "nullable": false,
668
+ "default": "CURRENT_TIMESTAMP"
669
+ },
670
+ {
671
+ "name": "metadata_json",
672
+ "type": "JSON",
673
+ "nullable": true
674
+ }
675
+ ],
676
+ "indexes": [
677
+ {
678
+ "name": "ux_artifact_resource_links_primary_component",
679
+ "def": "CREATE UNIQUE INDEX ux_artifact_resource_links_primary_component\n ON artifact_resource_links (artifact_component_instance_id, resource_role_code)\n WHERE artifact_component_instance_id IS NOT NULL AND is_primary = 1",
680
+ "table": "artifact_resource_links",
681
+ "columns": [
682
+ "artifact_component_instance_id",
683
+ "resource_role_code"
684
+ ]
685
+ },
686
+ {
687
+ "name": "ux_artifact_resource_links_primary_artifact",
688
+ "def": "CREATE UNIQUE INDEX ux_artifact_resource_links_primary_artifact\n ON artifact_resource_links (artifact_instance_id, resource_role_code)\n WHERE artifact_component_instance_id IS NULL AND is_primary = 1",
689
+ "table": "artifact_resource_links",
690
+ "columns": [
691
+ "artifact_instance_id",
692
+ "resource_role_code"
693
+ ]
694
+ },
695
+ {
696
+ "name": "idx_artifact_resource_links_component",
697
+ "def": "CREATE INDEX idx_artifact_resource_links_component\n ON artifact_resource_links (artifact_component_instance_id)",
698
+ "table": "artifact_resource_links",
699
+ "columns": [
700
+ "artifact_component_instance_id"
701
+ ]
702
+ },
703
+ {
704
+ "name": "idx_artifact_resource_links_artifact",
705
+ "def": "CREATE INDEX idx_artifact_resource_links_artifact\n ON artifact_resource_links (artifact_instance_id)",
706
+ "table": "artifact_resource_links",
707
+ "columns": [
708
+ "artifact_instance_id"
709
+ ]
710
+ },
711
+ {
712
+ "name": "sqlite_autoindex_artifact_resource_links_1",
713
+ "def": "PRIMARY KEY (artifact_resource_link_id)",
714
+ "table": "artifact_resource_links",
715
+ "columns": [
716
+ "artifact_resource_link_id"
717
+ ]
718
+ }
719
+ ],
720
+ "constraints": [
721
+ {
722
+ "name": "artifact_resource_link_id",
723
+ "type": "PRIMARY KEY",
724
+ "def": "PRIMARY KEY (artifact_resource_link_id)",
725
+ "table": "artifact_resource_links",
726
+ "columns": [
727
+ "artifact_resource_link_id"
728
+ ]
729
+ },
730
+ {
731
+ "name": "- (Foreign key ID: 0)",
732
+ "type": "FOREIGN KEY",
733
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
734
+ "table": "artifact_resource_links",
735
+ "referenced_table": "artifact_component_instances",
736
+ "columns": [
737
+ "artifact_component_instance_id"
738
+ ],
739
+ "referenced_columns": [
740
+ "artifact_component_instance_id"
741
+ ]
742
+ },
743
+ {
744
+ "name": "- (Foreign key ID: 1)",
745
+ "type": "FOREIGN KEY",
746
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
747
+ "table": "artifact_resource_links",
748
+ "referenced_table": "artifact_instances",
749
+ "columns": [
750
+ "artifact_instance_id"
751
+ ],
752
+ "referenced_columns": [
753
+ "artifact_instance_id"
754
+ ]
755
+ },
756
+ {
757
+ "name": "sqlite_autoindex_artifact_resource_links_1",
758
+ "type": "PRIMARY KEY",
759
+ "def": "PRIMARY KEY (artifact_resource_link_id)",
760
+ "table": "artifact_resource_links",
761
+ "columns": [
762
+ "artifact_resource_link_id"
763
+ ]
764
+ },
765
+ {
766
+ "name": "-",
767
+ "type": "CHECK",
768
+ "def": "CHECK (length(artifact_resource_link_id) = 36)",
769
+ "table": "artifact_resource_links",
770
+ "columns": [
771
+ "artifact_resource_link_id"
772
+ ]
773
+ },
774
+ {
775
+ "name": "-",
776
+ "type": "CHECK",
777
+ "def": "CHECK (length(artifact_instance_id) = 36)",
778
+ "table": "artifact_resource_links",
779
+ "columns": [
780
+ "artifact_instance_id"
781
+ ]
782
+ },
783
+ {
784
+ "name": "-",
785
+ "type": "CHECK",
786
+ "def": "CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36)",
787
+ "table": "artifact_resource_links",
788
+ "columns": [
789
+ "artifact_component_instance_id"
790
+ ]
791
+ },
792
+ {
793
+ "name": "-",
794
+ "type": "CHECK",
795
+ "def": "CHECK (resource_type_code IN ('DOCUMENT_ID', 'FILE_PATH', 'URL', 'AGENT_RESOURCE_REF'))",
796
+ "table": "artifact_resource_links",
797
+ "columns": [
798
+ "resource_type_code"
799
+ ]
800
+ },
801
+ {
802
+ "name": "-",
803
+ "type": "CHECK",
804
+ "def": "CHECK (resource_role_code IN ('CONTENT', 'RENDERED_OUTPUT', 'SOURCE', 'REFERENCE', 'ATTACHMENT'))",
805
+ "table": "artifact_resource_links",
806
+ "columns": [
807
+ "resource_role_code"
808
+ ]
809
+ },
810
+ {
811
+ "name": "-",
812
+ "type": "CHECK",
813
+ "def": "CHECK (is_primary IN (0, 1))",
814
+ "table": "artifact_resource_links",
815
+ "columns": [
816
+ "is_primary"
817
+ ]
818
+ },
819
+ {
820
+ "name": "-",
821
+ "type": "CHECK",
822
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
823
+ "table": "artifact_resource_links",
824
+ "columns": [
825
+ "metadata_json"
826
+ ]
827
+ }
828
+ ],
829
+ "def": "CREATE TABLE artifact_resource_links (\n artifact_resource_link_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_resource_link_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_instance_id CHAR(36)\n CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36),\n resource_type_code VARCHAR(64) NOT NULL\n CHECK (resource_type_code IN ('DOCUMENT_ID', 'FILE_PATH', 'URL', 'AGENT_RESOURCE_REF')),\n resource_ref VARCHAR(1024) NOT NULL,\n resource_role_code VARCHAR(64) NOT NULL DEFAULT 'CONTENT'\n CHECK (resource_role_code IN ('CONTENT', 'RENDERED_OUTPUT', 'SOURCE', 'REFERENCE', 'ATTACHMENT')),\n is_primary INTEGER NOT NULL DEFAULT 0\n CHECK (is_primary IN (0, 1)),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_component_instance_id)\n REFERENCES artifact_component_instances (artifact_component_instance_id)\n ON DELETE CASCADE\n)"
830
+ },
831
+ {
832
+ "name": "artifact_trace_links",
833
+ "type": "table",
834
+ "comment": "실제 산출물 instance와 방법론, 산출물 표준, 외부 실행 결과 간 trace를 관리한다.",
835
+ "columns": [
836
+ {
837
+ "name": "artifact_trace_link_id",
838
+ "type": "CHAR(36)",
839
+ "nullable": true
840
+ },
841
+ {
842
+ "name": "artifact_instance_id",
843
+ "type": "CHAR(36)",
844
+ "nullable": false
845
+ },
846
+ {
847
+ "name": "artifact_component_instance_id",
848
+ "type": "CHAR(36)",
849
+ "nullable": true
850
+ },
851
+ {
852
+ "name": "source_type_code",
853
+ "type": "VARCHAR(128)",
854
+ "nullable": false
855
+ },
856
+ {
857
+ "name": "source_ref_id",
858
+ "type": "VARCHAR(256)",
859
+ "nullable": false
860
+ },
861
+ {
862
+ "name": "trace_type_code",
863
+ "type": "VARCHAR(64)",
864
+ "nullable": false
865
+ },
866
+ {
867
+ "name": "artifact_standard_code",
868
+ "type": "VARCHAR(128)",
869
+ "nullable": true
870
+ },
871
+ {
872
+ "name": "artifact_standard_version",
873
+ "type": "VARCHAR(64)",
874
+ "nullable": true
875
+ },
876
+ {
877
+ "name": "artifact_component_code",
878
+ "type": "VARCHAR(128)",
879
+ "nullable": true
880
+ },
881
+ {
882
+ "name": "created_at",
883
+ "type": "DATETIME",
884
+ "nullable": false,
885
+ "default": "CURRENT_TIMESTAMP"
886
+ },
887
+ {
888
+ "name": "updated_at",
889
+ "type": "DATETIME",
890
+ "nullable": false,
891
+ "default": "CURRENT_TIMESTAMP"
892
+ },
893
+ {
894
+ "name": "metadata_json",
895
+ "type": "JSON",
896
+ "nullable": true
897
+ }
898
+ ],
899
+ "indexes": [
900
+ {
901
+ "name": "idx_artifact_trace_links_source",
902
+ "def": "CREATE INDEX idx_artifact_trace_links_source\n ON artifact_trace_links (source_type_code, source_ref_id)",
903
+ "table": "artifact_trace_links",
904
+ "columns": [
905
+ "source_type_code",
906
+ "source_ref_id"
907
+ ]
908
+ },
909
+ {
910
+ "name": "idx_artifact_trace_links_artifact",
911
+ "def": "CREATE INDEX idx_artifact_trace_links_artifact\n ON artifact_trace_links (artifact_instance_id)",
912
+ "table": "artifact_trace_links",
913
+ "columns": [
914
+ "artifact_instance_id"
915
+ ]
916
+ },
917
+ {
918
+ "name": "sqlite_autoindex_artifact_trace_links_1",
919
+ "def": "PRIMARY KEY (artifact_trace_link_id)",
920
+ "table": "artifact_trace_links",
921
+ "columns": [
922
+ "artifact_trace_link_id"
923
+ ]
924
+ }
925
+ ],
926
+ "constraints": [
927
+ {
928
+ "name": "artifact_trace_link_id",
929
+ "type": "PRIMARY KEY",
930
+ "def": "PRIMARY KEY (artifact_trace_link_id)",
931
+ "table": "artifact_trace_links",
932
+ "columns": [
933
+ "artifact_trace_link_id"
934
+ ]
935
+ },
936
+ {
937
+ "name": "- (Foreign key ID: 0)",
938
+ "type": "FOREIGN KEY",
939
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
940
+ "table": "artifact_trace_links",
941
+ "referenced_table": "artifact_component_instances",
942
+ "columns": [
943
+ "artifact_component_instance_id"
944
+ ],
945
+ "referenced_columns": [
946
+ "artifact_component_instance_id"
947
+ ]
948
+ },
949
+ {
950
+ "name": "- (Foreign key ID: 1)",
951
+ "type": "FOREIGN KEY",
952
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
953
+ "table": "artifact_trace_links",
954
+ "referenced_table": "artifact_instances",
955
+ "columns": [
956
+ "artifact_instance_id"
957
+ ],
958
+ "referenced_columns": [
959
+ "artifact_instance_id"
960
+ ]
961
+ },
962
+ {
963
+ "name": "sqlite_autoindex_artifact_trace_links_1",
964
+ "type": "PRIMARY KEY",
965
+ "def": "PRIMARY KEY (artifact_trace_link_id)",
966
+ "table": "artifact_trace_links",
967
+ "columns": [
968
+ "artifact_trace_link_id"
969
+ ]
970
+ },
971
+ {
972
+ "name": "-",
973
+ "type": "CHECK",
974
+ "def": "CHECK (length(artifact_trace_link_id) = 36)",
975
+ "table": "artifact_trace_links",
976
+ "columns": [
977
+ "artifact_trace_link_id"
978
+ ]
979
+ },
980
+ {
981
+ "name": "-",
982
+ "type": "CHECK",
983
+ "def": "CHECK (length(artifact_instance_id) = 36)",
984
+ "table": "artifact_trace_links",
985
+ "columns": [
986
+ "artifact_instance_id"
987
+ ]
988
+ },
989
+ {
990
+ "name": "-",
991
+ "type": "CHECK",
992
+ "def": "CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36)",
993
+ "table": "artifact_trace_links",
994
+ "columns": [
995
+ "artifact_component_instance_id"
996
+ ]
997
+ },
998
+ {
999
+ "name": "-",
1000
+ "type": "CHECK",
1001
+ "def": "CHECK (trace_type_code IN ('produced_by', 'refined_by', 'reviewed_by', 'consolidated_by', 'derived_from', 'references'))",
1002
+ "table": "artifact_trace_links",
1003
+ "columns": [
1004
+ "trace_type_code"
1005
+ ]
1006
+ },
1007
+ {
1008
+ "name": "-",
1009
+ "type": "CHECK",
1010
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
1011
+ "table": "artifact_trace_links",
1012
+ "columns": [
1013
+ "metadata_json"
1014
+ ]
1015
+ },
1016
+ {
1017
+ "name": "-",
1018
+ "type": "CHECK",
1019
+ "def": "CHECK ( (artifact_standard_code IS NULL AND artifact_standard_version IS NULL) OR (artifact_standard_code IS NOT NULL AND artifact_standard_version IS NOT NULL) )",
1020
+ "table": "artifact_trace_links",
1021
+ "columns": [
1022
+ "artifact_standard_code",
1023
+ "artifact_standard_version"
1024
+ ]
1025
+ }
1026
+ ],
1027
+ "def": "CREATE TABLE artifact_trace_links (\n artifact_trace_link_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_trace_link_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_instance_id CHAR(36)\n CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36),\n source_type_code VARCHAR(128) NOT NULL,\n source_ref_id VARCHAR(256) NOT NULL,\n trace_type_code VARCHAR(64) NOT NULL\n CHECK (trace_type_code IN ('produced_by', 'refined_by', 'reviewed_by', 'consolidated_by', 'derived_from', 'references')),\n artifact_standard_code VARCHAR(128),\n artifact_standard_version VARCHAR(64),\n artifact_component_code VARCHAR(128),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_component_instance_id)\n REFERENCES artifact_component_instances (artifact_component_instance_id)\n ON DELETE CASCADE,\n\n CHECK (\n (artifact_standard_code IS NULL AND artifact_standard_version IS NULL)\n OR (artifact_standard_code IS NOT NULL AND artifact_standard_version IS NOT NULL)\n )\n)"
1028
+ },
1029
+ {
1030
+ "name": "artifact_validation_result_refs",
1031
+ "type": "table",
1032
+ "comment": "validation 실행 결과의 외부 참조를 관리한다.",
1033
+ "columns": [
1034
+ {
1035
+ "name": "artifact_validation_result_ref_id",
1036
+ "type": "CHAR(36)",
1037
+ "nullable": true
1038
+ },
1039
+ {
1040
+ "name": "artifact_instance_id",
1041
+ "type": "CHAR(36)",
1042
+ "nullable": false
1043
+ },
1044
+ {
1045
+ "name": "artifact_component_instance_id",
1046
+ "type": "CHAR(36)",
1047
+ "nullable": true
1048
+ },
1049
+ {
1050
+ "name": "validation_provider_id",
1051
+ "type": "VARCHAR(256)",
1052
+ "nullable": false
1053
+ },
1054
+ {
1055
+ "name": "validation_profile_id",
1056
+ "type": "VARCHAR(256)",
1057
+ "nullable": false
1058
+ },
1059
+ {
1060
+ "name": "validation_result_ref",
1061
+ "type": "VARCHAR(1024)",
1062
+ "nullable": false
1063
+ },
1064
+ {
1065
+ "name": "validation_status_code",
1066
+ "type": "VARCHAR(64)",
1067
+ "nullable": false
1068
+ },
1069
+ {
1070
+ "name": "created_at",
1071
+ "type": "DATETIME",
1072
+ "nullable": false,
1073
+ "default": "CURRENT_TIMESTAMP"
1074
+ },
1075
+ {
1076
+ "name": "updated_at",
1077
+ "type": "DATETIME",
1078
+ "nullable": false,
1079
+ "default": "CURRENT_TIMESTAMP"
1080
+ },
1081
+ {
1082
+ "name": "metadata_json",
1083
+ "type": "JSON",
1084
+ "nullable": true
1085
+ }
1086
+ ],
1087
+ "indexes": [
1088
+ {
1089
+ "name": "idx_artifact_validation_result_refs_artifact",
1090
+ "def": "CREATE INDEX idx_artifact_validation_result_refs_artifact\n ON artifact_validation_result_refs (artifact_instance_id)",
1091
+ "table": "artifact_validation_result_refs",
1092
+ "columns": [
1093
+ "artifact_instance_id"
1094
+ ]
1095
+ },
1096
+ {
1097
+ "name": "sqlite_autoindex_artifact_validation_result_refs_1",
1098
+ "def": "PRIMARY KEY (artifact_validation_result_ref_id)",
1099
+ "table": "artifact_validation_result_refs",
1100
+ "columns": [
1101
+ "artifact_validation_result_ref_id"
1102
+ ]
1103
+ }
1104
+ ],
1105
+ "constraints": [
1106
+ {
1107
+ "name": "artifact_validation_result_ref_id",
1108
+ "type": "PRIMARY KEY",
1109
+ "def": "PRIMARY KEY (artifact_validation_result_ref_id)",
1110
+ "table": "artifact_validation_result_refs",
1111
+ "columns": [
1112
+ "artifact_validation_result_ref_id"
1113
+ ]
1114
+ },
1115
+ {
1116
+ "name": "- (Foreign key ID: 0)",
1117
+ "type": "FOREIGN KEY",
1118
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1119
+ "table": "artifact_validation_result_refs",
1120
+ "referenced_table": "artifact_component_instances",
1121
+ "columns": [
1122
+ "artifact_component_instance_id"
1123
+ ],
1124
+ "referenced_columns": [
1125
+ "artifact_component_instance_id"
1126
+ ]
1127
+ },
1128
+ {
1129
+ "name": "- (Foreign key ID: 1)",
1130
+ "type": "FOREIGN KEY",
1131
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1132
+ "table": "artifact_validation_result_refs",
1133
+ "referenced_table": "artifact_instances",
1134
+ "columns": [
1135
+ "artifact_instance_id"
1136
+ ],
1137
+ "referenced_columns": [
1138
+ "artifact_instance_id"
1139
+ ]
1140
+ },
1141
+ {
1142
+ "name": "sqlite_autoindex_artifact_validation_result_refs_1",
1143
+ "type": "PRIMARY KEY",
1144
+ "def": "PRIMARY KEY (artifact_validation_result_ref_id)",
1145
+ "table": "artifact_validation_result_refs",
1146
+ "columns": [
1147
+ "artifact_validation_result_ref_id"
1148
+ ]
1149
+ },
1150
+ {
1151
+ "name": "-",
1152
+ "type": "CHECK",
1153
+ "def": "CHECK (length(artifact_validation_result_ref_id) = 36)",
1154
+ "table": "artifact_validation_result_refs",
1155
+ "columns": [
1156
+ "artifact_validation_result_ref_id",
1157
+ "validation_result_ref"
1158
+ ]
1159
+ },
1160
+ {
1161
+ "name": "-",
1162
+ "type": "CHECK",
1163
+ "def": "CHECK (length(artifact_instance_id) = 36)",
1164
+ "table": "artifact_validation_result_refs",
1165
+ "columns": [
1166
+ "artifact_instance_id"
1167
+ ]
1168
+ },
1169
+ {
1170
+ "name": "-",
1171
+ "type": "CHECK",
1172
+ "def": "CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36)",
1173
+ "table": "artifact_validation_result_refs",
1174
+ "columns": [
1175
+ "artifact_component_instance_id"
1176
+ ]
1177
+ },
1178
+ {
1179
+ "name": "-",
1180
+ "type": "CHECK",
1181
+ "def": "CHECK (validation_status_code IN ('valid', 'invalid', 'warning', 'not_run'))",
1182
+ "table": "artifact_validation_result_refs",
1183
+ "columns": [
1184
+ "validation_status_code"
1185
+ ]
1186
+ },
1187
+ {
1188
+ "name": "-",
1189
+ "type": "CHECK",
1190
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
1191
+ "table": "artifact_validation_result_refs",
1192
+ "columns": [
1193
+ "metadata_json"
1194
+ ]
1195
+ }
1196
+ ],
1197
+ "def": "CREATE TABLE artifact_validation_result_refs (\n artifact_validation_result_ref_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_validation_result_ref_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_instance_id CHAR(36)\n CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36),\n validation_provider_id VARCHAR(256) NOT NULL,\n validation_profile_id VARCHAR(256) NOT NULL,\n validation_result_ref VARCHAR(1024) NOT NULL,\n validation_status_code VARCHAR(64) NOT NULL\n CHECK (validation_status_code IN ('valid', 'invalid', 'warning', 'not_run')),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_component_instance_id)\n REFERENCES artifact_component_instances (artifact_component_instance_id)\n ON DELETE CASCADE\n)"
1198
+ },
1199
+ {
1200
+ "name": "artifact_review_decision_refs",
1201
+ "type": "table",
1202
+ "comment": "산출물 instance 또는 component에 대한 검토 결정 외부 참조를 관리한다.",
1203
+ "columns": [
1204
+ {
1205
+ "name": "artifact_review_decision_ref_id",
1206
+ "type": "CHAR(36)",
1207
+ "nullable": true
1208
+ },
1209
+ {
1210
+ "name": "artifact_instance_id",
1211
+ "type": "CHAR(36)",
1212
+ "nullable": false
1213
+ },
1214
+ {
1215
+ "name": "artifact_component_instance_id",
1216
+ "type": "CHAR(36)",
1217
+ "nullable": true
1218
+ },
1219
+ {
1220
+ "name": "review_scope_code",
1221
+ "type": "VARCHAR(64)",
1222
+ "nullable": false
1223
+ },
1224
+ {
1225
+ "name": "decision_code",
1226
+ "type": "VARCHAR(64)",
1227
+ "nullable": false
1228
+ },
1229
+ {
1230
+ "name": "reviewer_ref",
1231
+ "type": "VARCHAR(256)",
1232
+ "nullable": true
1233
+ },
1234
+ {
1235
+ "name": "decision_reason",
1236
+ "type": "TEXT",
1237
+ "nullable": true
1238
+ },
1239
+ {
1240
+ "name": "decision_result_ref",
1241
+ "type": "VARCHAR(1024)",
1242
+ "nullable": false
1243
+ },
1244
+ {
1245
+ "name": "decided_at",
1246
+ "type": "DATETIME",
1247
+ "nullable": false,
1248
+ "default": "CURRENT_TIMESTAMP"
1249
+ },
1250
+ {
1251
+ "name": "created_at",
1252
+ "type": "DATETIME",
1253
+ "nullable": false,
1254
+ "default": "CURRENT_TIMESTAMP"
1255
+ },
1256
+ {
1257
+ "name": "updated_at",
1258
+ "type": "DATETIME",
1259
+ "nullable": false,
1260
+ "default": "CURRENT_TIMESTAMP"
1261
+ },
1262
+ {
1263
+ "name": "metadata_json",
1264
+ "type": "JSON",
1265
+ "nullable": true
1266
+ }
1267
+ ],
1268
+ "indexes": [
1269
+ {
1270
+ "name": "idx_artifact_review_decision_refs_component",
1271
+ "def": "CREATE INDEX idx_artifact_review_decision_refs_component\n ON artifact_review_decision_refs (artifact_component_instance_id, decision_code, decided_at)",
1272
+ "table": "artifact_review_decision_refs",
1273
+ "columns": [
1274
+ "artifact_component_instance_id",
1275
+ "decision_code",
1276
+ "decided_at"
1277
+ ]
1278
+ },
1279
+ {
1280
+ "name": "idx_artifact_review_decision_refs_artifact",
1281
+ "def": "CREATE INDEX idx_artifact_review_decision_refs_artifact\n ON artifact_review_decision_refs (artifact_instance_id, decision_code, decided_at)",
1282
+ "table": "artifact_review_decision_refs",
1283
+ "columns": [
1284
+ "artifact_instance_id",
1285
+ "decision_code",
1286
+ "decided_at"
1287
+ ]
1288
+ },
1289
+ {
1290
+ "name": "sqlite_autoindex_artifact_review_decision_refs_1",
1291
+ "def": "PRIMARY KEY (artifact_review_decision_ref_id)",
1292
+ "table": "artifact_review_decision_refs",
1293
+ "columns": [
1294
+ "artifact_review_decision_ref_id"
1295
+ ]
1296
+ }
1297
+ ],
1298
+ "constraints": [
1299
+ {
1300
+ "name": "artifact_review_decision_ref_id",
1301
+ "type": "PRIMARY KEY",
1302
+ "def": "PRIMARY KEY (artifact_review_decision_ref_id)",
1303
+ "table": "artifact_review_decision_refs",
1304
+ "columns": [
1305
+ "artifact_review_decision_ref_id"
1306
+ ]
1307
+ },
1308
+ {
1309
+ "name": "- (Foreign key ID: 0)",
1310
+ "type": "FOREIGN KEY",
1311
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1312
+ "table": "artifact_review_decision_refs",
1313
+ "referenced_table": "artifact_component_instances",
1314
+ "columns": [
1315
+ "artifact_component_instance_id"
1316
+ ],
1317
+ "referenced_columns": [
1318
+ "artifact_component_instance_id"
1319
+ ]
1320
+ },
1321
+ {
1322
+ "name": "- (Foreign key ID: 1)",
1323
+ "type": "FOREIGN KEY",
1324
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1325
+ "table": "artifact_review_decision_refs",
1326
+ "referenced_table": "artifact_instances",
1327
+ "columns": [
1328
+ "artifact_instance_id"
1329
+ ],
1330
+ "referenced_columns": [
1331
+ "artifact_instance_id"
1332
+ ]
1333
+ },
1334
+ {
1335
+ "name": "sqlite_autoindex_artifact_review_decision_refs_1",
1336
+ "type": "PRIMARY KEY",
1337
+ "def": "PRIMARY KEY (artifact_review_decision_ref_id)",
1338
+ "table": "artifact_review_decision_refs",
1339
+ "columns": [
1340
+ "artifact_review_decision_ref_id"
1341
+ ]
1342
+ },
1343
+ {
1344
+ "name": "-",
1345
+ "type": "CHECK",
1346
+ "def": "CHECK (length(artifact_review_decision_ref_id) = 36)",
1347
+ "table": "artifact_review_decision_refs",
1348
+ "columns": [
1349
+ "artifact_review_decision_ref_id"
1350
+ ]
1351
+ },
1352
+ {
1353
+ "name": "-",
1354
+ "type": "CHECK",
1355
+ "def": "CHECK (length(artifact_instance_id) = 36)",
1356
+ "table": "artifact_review_decision_refs",
1357
+ "columns": [
1358
+ "artifact_instance_id"
1359
+ ]
1360
+ },
1361
+ {
1362
+ "name": "-",
1363
+ "type": "CHECK",
1364
+ "def": "CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36)",
1365
+ "table": "artifact_review_decision_refs",
1366
+ "columns": [
1367
+ "artifact_component_instance_id"
1368
+ ]
1369
+ },
1370
+ {
1371
+ "name": "-",
1372
+ "type": "CHECK",
1373
+ "def": "CHECK (review_scope_code IN ('artifact_instance', 'artifact_component', 'stage', 'activity'))",
1374
+ "table": "artifact_review_decision_refs",
1375
+ "columns": [
1376
+ "review_scope_code"
1377
+ ]
1378
+ },
1379
+ {
1380
+ "name": "-",
1381
+ "type": "CHECK",
1382
+ "def": "CHECK (decision_code IN ('approved', 'changes_requested', 'rejected', 'deferred'))",
1383
+ "table": "artifact_review_decision_refs",
1384
+ "columns": [
1385
+ "decision_code"
1386
+ ]
1387
+ },
1388
+ {
1389
+ "name": "-",
1390
+ "type": "CHECK",
1391
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
1392
+ "table": "artifact_review_decision_refs",
1393
+ "columns": [
1394
+ "metadata_json"
1395
+ ]
1396
+ }
1397
+ ],
1398
+ "def": "CREATE TABLE artifact_review_decision_refs (\n artifact_review_decision_ref_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_review_decision_ref_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_instance_id CHAR(36)\n CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36),\n review_scope_code VARCHAR(64) NOT NULL\n CHECK (review_scope_code IN ('artifact_instance', 'artifact_component', 'stage', 'activity')),\n decision_code VARCHAR(64) NOT NULL\n CHECK (decision_code IN ('approved', 'changes_requested', 'rejected', 'deferred')),\n reviewer_ref VARCHAR(256),\n decision_reason TEXT,\n decision_result_ref VARCHAR(1024) NOT NULL,\n decided_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_component_instance_id)\n REFERENCES artifact_component_instances (artifact_component_instance_id)\n ON DELETE CASCADE\n)"
1399
+ },
1400
+ {
1401
+ "name": "artifact_status_events",
1402
+ "type": "table",
1403
+ "comment": "산출물 instance 또는 component의 상태 전이 이력을 관리한다.",
1404
+ "columns": [
1405
+ {
1406
+ "name": "artifact_status_event_id",
1407
+ "type": "CHAR(36)",
1408
+ "nullable": true
1409
+ },
1410
+ {
1411
+ "name": "artifact_instance_id",
1412
+ "type": "CHAR(36)",
1413
+ "nullable": false
1414
+ },
1415
+ {
1416
+ "name": "artifact_component_instance_id",
1417
+ "type": "CHAR(36)",
1418
+ "nullable": true
1419
+ },
1420
+ {
1421
+ "name": "status_scope_code",
1422
+ "type": "VARCHAR(64)",
1423
+ "nullable": false
1424
+ },
1425
+ {
1426
+ "name": "from_status_code",
1427
+ "type": "VARCHAR(64)",
1428
+ "nullable": false
1429
+ },
1430
+ {
1431
+ "name": "to_status_code",
1432
+ "type": "VARCHAR(64)",
1433
+ "nullable": false
1434
+ },
1435
+ {
1436
+ "name": "transition_reason",
1437
+ "type": "TEXT",
1438
+ "nullable": true
1439
+ },
1440
+ {
1441
+ "name": "actor_ref",
1442
+ "type": "VARCHAR(256)",
1443
+ "nullable": true
1444
+ },
1445
+ {
1446
+ "name": "artifact_review_decision_ref_id",
1447
+ "type": "CHAR(36)",
1448
+ "nullable": true
1449
+ },
1450
+ {
1451
+ "name": "created_at",
1452
+ "type": "DATETIME",
1453
+ "nullable": false,
1454
+ "default": "CURRENT_TIMESTAMP"
1455
+ },
1456
+ {
1457
+ "name": "metadata_json",
1458
+ "type": "JSON",
1459
+ "nullable": true
1460
+ }
1461
+ ],
1462
+ "indexes": [
1463
+ {
1464
+ "name": "idx_artifact_status_events_component",
1465
+ "def": "CREATE INDEX idx_artifact_status_events_component\n ON artifact_status_events (artifact_component_instance_id, created_at)",
1466
+ "table": "artifact_status_events",
1467
+ "columns": [
1468
+ "artifact_component_instance_id",
1469
+ "created_at"
1470
+ ]
1471
+ },
1472
+ {
1473
+ "name": "idx_artifact_status_events_artifact",
1474
+ "def": "CREATE INDEX idx_artifact_status_events_artifact\n ON artifact_status_events (artifact_instance_id, created_at)",
1475
+ "table": "artifact_status_events",
1476
+ "columns": [
1477
+ "artifact_instance_id",
1478
+ "created_at"
1479
+ ]
1480
+ },
1481
+ {
1482
+ "name": "sqlite_autoindex_artifact_status_events_1",
1483
+ "def": "PRIMARY KEY (artifact_status_event_id)",
1484
+ "table": "artifact_status_events",
1485
+ "columns": [
1486
+ "artifact_status_event_id"
1487
+ ]
1488
+ }
1489
+ ],
1490
+ "constraints": [
1491
+ {
1492
+ "name": "artifact_status_event_id",
1493
+ "type": "PRIMARY KEY",
1494
+ "def": "PRIMARY KEY (artifact_status_event_id)",
1495
+ "table": "artifact_status_events",
1496
+ "columns": [
1497
+ "artifact_status_event_id"
1498
+ ]
1499
+ },
1500
+ {
1501
+ "name": "- (Foreign key ID: 0)",
1502
+ "type": "FOREIGN KEY",
1503
+ "def": "FOREIGN KEY (artifact_review_decision_ref_id) REFERENCES artifact_review_decision_refs (artifact_review_decision_ref_id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE",
1504
+ "table": "artifact_status_events",
1505
+ "referenced_table": "artifact_review_decision_refs",
1506
+ "columns": [
1507
+ "artifact_review_decision_ref_id"
1508
+ ],
1509
+ "referenced_columns": [
1510
+ "artifact_review_decision_ref_id"
1511
+ ]
1512
+ },
1513
+ {
1514
+ "name": "- (Foreign key ID: 1)",
1515
+ "type": "FOREIGN KEY",
1516
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1517
+ "table": "artifact_status_events",
1518
+ "referenced_table": "artifact_component_instances",
1519
+ "columns": [
1520
+ "artifact_component_instance_id"
1521
+ ],
1522
+ "referenced_columns": [
1523
+ "artifact_component_instance_id"
1524
+ ]
1525
+ },
1526
+ {
1527
+ "name": "- (Foreign key ID: 2)",
1528
+ "type": "FOREIGN KEY",
1529
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE",
1530
+ "table": "artifact_status_events",
1531
+ "referenced_table": "artifact_instances",
1532
+ "columns": [
1533
+ "artifact_instance_id"
1534
+ ],
1535
+ "referenced_columns": [
1536
+ "artifact_instance_id"
1537
+ ]
1538
+ },
1539
+ {
1540
+ "name": "sqlite_autoindex_artifact_status_events_1",
1541
+ "type": "PRIMARY KEY",
1542
+ "def": "PRIMARY KEY (artifact_status_event_id)",
1543
+ "table": "artifact_status_events",
1544
+ "columns": [
1545
+ "artifact_status_event_id"
1546
+ ]
1547
+ },
1548
+ {
1549
+ "name": "-",
1550
+ "type": "CHECK",
1551
+ "def": "CHECK (length(artifact_status_event_id) = 36)",
1552
+ "table": "artifact_status_events",
1553
+ "columns": [
1554
+ "artifact_status_event_id"
1555
+ ]
1556
+ },
1557
+ {
1558
+ "name": "-",
1559
+ "type": "CHECK",
1560
+ "def": "CHECK (length(artifact_instance_id) = 36)",
1561
+ "table": "artifact_status_events",
1562
+ "columns": [
1563
+ "artifact_instance_id"
1564
+ ]
1565
+ },
1566
+ {
1567
+ "name": "-",
1568
+ "type": "CHECK",
1569
+ "def": "CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36)",
1570
+ "table": "artifact_status_events",
1571
+ "columns": [
1572
+ "artifact_component_instance_id"
1573
+ ]
1574
+ },
1575
+ {
1576
+ "name": "-",
1577
+ "type": "CHECK",
1578
+ "def": "CHECK (status_scope_code IN ('artifact_instance', 'artifact_component'))",
1579
+ "table": "artifact_status_events",
1580
+ "columns": [
1581
+ "status_scope_code"
1582
+ ]
1583
+ },
1584
+ {
1585
+ "name": "-",
1586
+ "type": "CHECK",
1587
+ "def": "CHECK (from_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated'))",
1588
+ "table": "artifact_status_events",
1589
+ "columns": [
1590
+ "from_status_code"
1591
+ ]
1592
+ },
1593
+ {
1594
+ "name": "-",
1595
+ "type": "CHECK",
1596
+ "def": "CHECK (to_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated'))",
1597
+ "table": "artifact_status_events",
1598
+ "columns": [
1599
+ "to_status_code"
1600
+ ]
1601
+ },
1602
+ {
1603
+ "name": "-",
1604
+ "type": "CHECK",
1605
+ "def": "CHECK (artifact_review_decision_ref_id IS NULL OR length(artifact_review_decision_ref_id) = 36)",
1606
+ "table": "artifact_status_events",
1607
+ "columns": [
1608
+ "artifact_review_decision_ref_id"
1609
+ ]
1610
+ },
1611
+ {
1612
+ "name": "-",
1613
+ "type": "CHECK",
1614
+ "def": "CHECK (metadata_json IS NULL OR json_valid(metadata_json))",
1615
+ "table": "artifact_status_events",
1616
+ "columns": [
1617
+ "metadata_json"
1618
+ ]
1619
+ }
1620
+ ],
1621
+ "def": "CREATE TABLE artifact_status_events (\n artifact_status_event_id CHAR(36) PRIMARY KEY\n CHECK (length(artifact_status_event_id) = 36),\n artifact_instance_id CHAR(36) NOT NULL\n CHECK (length(artifact_instance_id) = 36),\n artifact_component_instance_id CHAR(36)\n CHECK (artifact_component_instance_id IS NULL OR length(artifact_component_instance_id) = 36),\n status_scope_code VARCHAR(64) NOT NULL\n CHECK (status_scope_code IN ('artifact_instance', 'artifact_component')),\n from_status_code VARCHAR(64) NOT NULL\n CHECK (from_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated')),\n to_status_code VARCHAR(64) NOT NULL\n CHECK (to_status_code IN ('draft', 'in_review', 'approved', 'published', 'archived', 'deprecated')),\n transition_reason TEXT,\n actor_ref VARCHAR(256),\n artifact_review_decision_ref_id CHAR(36)\n CHECK (artifact_review_decision_ref_id IS NULL OR length(artifact_review_decision_ref_id) = 36),\n created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n metadata_json JSON\n CHECK (metadata_json IS NULL OR json_valid(metadata_json)),\n\n FOREIGN KEY (artifact_instance_id)\n REFERENCES artifact_instances (artifact_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_component_instance_id)\n REFERENCES artifact_component_instances (artifact_component_instance_id)\n ON DELETE CASCADE,\n\n FOREIGN KEY (artifact_review_decision_ref_id)\n REFERENCES artifact_review_decision_refs (artifact_review_decision_ref_id)\n ON DELETE SET NULL\n)"
1622
+ }
1623
+ ],
1624
+ "relations": [
1625
+ {
1626
+ "table": "artifact_codes",
1627
+ "columns": [
1628
+ "code_group_code"
1629
+ ],
1630
+ "cardinality": "zero_or_one",
1631
+ "parent_table": "artifact_code_groups",
1632
+ "parent_columns": [
1633
+ "code_group_code"
1634
+ ],
1635
+ "parent_cardinality": "exactly_one",
1636
+ "def": "FOREIGN KEY (code_group_code) REFERENCES artifact_code_groups (code_group_code) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1637
+ },
1638
+ {
1639
+ "table": "artifact_component_instances",
1640
+ "columns": [
1641
+ "artifact_instance_id"
1642
+ ],
1643
+ "cardinality": "zero_or_more",
1644
+ "parent_table": "artifact_instances",
1645
+ "parent_columns": [
1646
+ "artifact_instance_id"
1647
+ ],
1648
+ "parent_cardinality": "exactly_one",
1649
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1650
+ },
1651
+ {
1652
+ "table": "artifact_resource_links",
1653
+ "columns": [
1654
+ "artifact_component_instance_id"
1655
+ ],
1656
+ "cardinality": "zero_or_more",
1657
+ "parent_table": "artifact_component_instances",
1658
+ "parent_columns": [
1659
+ "artifact_component_instance_id"
1660
+ ],
1661
+ "parent_cardinality": "zero_or_one",
1662
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1663
+ },
1664
+ {
1665
+ "table": "artifact_resource_links",
1666
+ "columns": [
1667
+ "artifact_instance_id"
1668
+ ],
1669
+ "cardinality": "zero_or_more",
1670
+ "parent_table": "artifact_instances",
1671
+ "parent_columns": [
1672
+ "artifact_instance_id"
1673
+ ],
1674
+ "parent_cardinality": "exactly_one",
1675
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1676
+ },
1677
+ {
1678
+ "table": "artifact_trace_links",
1679
+ "columns": [
1680
+ "artifact_component_instance_id"
1681
+ ],
1682
+ "cardinality": "zero_or_more",
1683
+ "parent_table": "artifact_component_instances",
1684
+ "parent_columns": [
1685
+ "artifact_component_instance_id"
1686
+ ],
1687
+ "parent_cardinality": "zero_or_one",
1688
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1689
+ },
1690
+ {
1691
+ "table": "artifact_trace_links",
1692
+ "columns": [
1693
+ "artifact_instance_id"
1694
+ ],
1695
+ "cardinality": "zero_or_more",
1696
+ "parent_table": "artifact_instances",
1697
+ "parent_columns": [
1698
+ "artifact_instance_id"
1699
+ ],
1700
+ "parent_cardinality": "exactly_one",
1701
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1702
+ },
1703
+ {
1704
+ "table": "artifact_validation_result_refs",
1705
+ "columns": [
1706
+ "artifact_component_instance_id"
1707
+ ],
1708
+ "cardinality": "zero_or_more",
1709
+ "parent_table": "artifact_component_instances",
1710
+ "parent_columns": [
1711
+ "artifact_component_instance_id"
1712
+ ],
1713
+ "parent_cardinality": "zero_or_one",
1714
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1715
+ },
1716
+ {
1717
+ "table": "artifact_validation_result_refs",
1718
+ "columns": [
1719
+ "artifact_instance_id"
1720
+ ],
1721
+ "cardinality": "zero_or_more",
1722
+ "parent_table": "artifact_instances",
1723
+ "parent_columns": [
1724
+ "artifact_instance_id"
1725
+ ],
1726
+ "parent_cardinality": "exactly_one",
1727
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1728
+ },
1729
+ {
1730
+ "table": "artifact_review_decision_refs",
1731
+ "columns": [
1732
+ "artifact_component_instance_id"
1733
+ ],
1734
+ "cardinality": "zero_or_more",
1735
+ "parent_table": "artifact_component_instances",
1736
+ "parent_columns": [
1737
+ "artifact_component_instance_id"
1738
+ ],
1739
+ "parent_cardinality": "zero_or_one",
1740
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1741
+ },
1742
+ {
1743
+ "table": "artifact_review_decision_refs",
1744
+ "columns": [
1745
+ "artifact_instance_id"
1746
+ ],
1747
+ "cardinality": "zero_or_more",
1748
+ "parent_table": "artifact_instances",
1749
+ "parent_columns": [
1750
+ "artifact_instance_id"
1751
+ ],
1752
+ "parent_cardinality": "exactly_one",
1753
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1754
+ },
1755
+ {
1756
+ "table": "artifact_status_events",
1757
+ "columns": [
1758
+ "artifact_review_decision_ref_id"
1759
+ ],
1760
+ "cardinality": "zero_or_more",
1761
+ "parent_table": "artifact_review_decision_refs",
1762
+ "parent_columns": [
1763
+ "artifact_review_decision_ref_id"
1764
+ ],
1765
+ "parent_cardinality": "zero_or_one",
1766
+ "def": "FOREIGN KEY (artifact_review_decision_ref_id) REFERENCES artifact_review_decision_refs (artifact_review_decision_ref_id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE"
1767
+ },
1768
+ {
1769
+ "table": "artifact_status_events",
1770
+ "columns": [
1771
+ "artifact_component_instance_id"
1772
+ ],
1773
+ "cardinality": "zero_or_more",
1774
+ "parent_table": "artifact_component_instances",
1775
+ "parent_columns": [
1776
+ "artifact_component_instance_id"
1777
+ ],
1778
+ "parent_cardinality": "zero_or_one",
1779
+ "def": "FOREIGN KEY (artifact_component_instance_id) REFERENCES artifact_component_instances (artifact_component_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1780
+ },
1781
+ {
1782
+ "table": "artifact_status_events",
1783
+ "columns": [
1784
+ "artifact_instance_id"
1785
+ ],
1786
+ "cardinality": "zero_or_more",
1787
+ "parent_table": "artifact_instances",
1788
+ "parent_columns": [
1789
+ "artifact_instance_id"
1790
+ ],
1791
+ "parent_cardinality": "exactly_one",
1792
+ "def": "FOREIGN KEY (artifact_instance_id) REFERENCES artifact_instances (artifact_instance_id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
1793
+ }
1794
+ ],
1795
+ "driver": {
1796
+ "name": "sqlite",
1797
+ "database_version": "3.51.3"
1798
+ }
1799
+ }