KB-53C3 rev 7

Directus Schema — Key Collections

3 min read Revision 7
directusschemacollectionscurrent-state

Directus Schema — Key Collections

Cập nhật: 2026-03-26 S139. Database = PostgreSQL 16 (MySQL retired S110). ⚠️ File này là snapshot tham khảo. Dùng PG query hoặc Directus API cho schema chính xác.

Tổng quan

  • Database: PostgreSQL 16 trên VPS (sole DB, MySQL hoàn toàn retired S104-S110)
  • Tổng collections: ~138+ user (theo birth_registry) + system collections
  • 18 managed collections theo Điều 26 Counting Law
  • 21 species theo Species Taxonomy v1.1
  • PG container: postgres

Collections Điều 31 — Integrity System

Collection Mục đích
meta_catalog "Bảng tuần hoàn" — catalog TẤT CẢ managed entities. CAT-ALL = PG trigger tự tính
v_registry_counts Đếm entities (⚠️ hiện là TABLE writable — TD-375 đang fix thành VIEW/guard)
system_issues Issues phát hiện bởi runner/scanner (⚠️ TD-376: thiếu authenticity guard)
entity_dependencies Dependencies giữa entities
universal_edges Quan hệ cạnh giữa entities (BELONGS_TO, etc.)
entity_species Species taxonomy (21 species)
birth_registry Birth certificates cho entities

Collections Workflow (M-002)

Collection Mục đích
workflows Workflow definitions
workflow_steps DSL Steps SSOT
workflow_step_relations Relations giữa steps
workflow_categories Phân cấp 3 cấp
workflow_change_requests WCR Governance
block_library Template blocks tái sử dụng

Collections Registry

Collection Mục đích
dot_tools DOT inspection tools (82+ tools)
taxonomy Taxonomy/label definitions
checkpoint_types Checkpoint type registry
trigger_registry Trigger definitions
label_registry Label definitions

Collections OPS

Collection Mục đích
tasks Task management
task_comments Feedback stream
ai_tasks AI Agent job queue

PG Triggers (26 total)

Bao gồm: trg_count_* cho managed collections, fn_refresh_cat_all, fn_guard_meta_catalog_delete, và các counting triggers. Chi tiết: query SELECT tgname FROM pg_trigger WHERE tgname LIKE 'trg_%'.

Directus Flows

Active flows bao gồm: 21+ registry sync flows, 13+ auto-ID flows, cron watchdogs, permission checks. Limitation: Directus v11.5.1 flows KHÔNG THỂ CRUD trên cùng collection với trigger.


Cập nhật: 2026-03-26 S139. Fix "MySQL" → PostgreSQL 16. Trước đó: S107.