Bỏ qua, đến nội dung

Database schema

ER Diagram

Chi tiết bảng

uiSchemas

Bảng chính lưu schema node. Sử dụng MagicAttributeModel — field schema là JSON chứa toàn bộ thuộc tính schema (type, x-component, x-component-props, title...).

FieldTypeMô tả
x-uidstring (PK)UID duy nhất, sinh tự động
namestringTên schema node (property key trong parent)
schemajsonMagic attribute — merge/tách tự động khi đọc/ghi

Khi đọc, schema JSON được merge với namex-uid thành JSON schema hoàn chỉnh. Khi ghi, JSON schema được tách — name, x-uid lưu riêng, phần còn lại vào schema.

uiSchemaTreePath — Closure Table

Tương tự uiWidgetTreePath, lưu mọi cặp ancestor-descendant.

FieldTypeMô tả
ancestorstring (FK)UID schema tổ tiên
descendantstring (FK)UID schema con cháu
depthintegerKhoảng cách: 0 = self, 1 = con trực tiếp
typestringPhân loại quan hệ
sortintegerThứ tự sắp xếp siblings

Composite PK: (ancestor, descendant)

uiSchemaTemplates

Lưu template schema tái sử dụng.

FieldTypeMô tả
keystring (PK)Unique key
namestringTên hiển thị
componentNamestringComponent chính (VD: TableBlockProvider, FormV2)
collectionNamestringCollection context (nếu template gắn collection)
dataSourceKeystringData source context
uidstring (FK)Trỏ về uiSchemas.x-uid — schema gốc của template

uiSchemaServerHooks

Lưu server-side hooks gắn vào schema node. Khi event xảy ra, hook sẽ gọi method tương ứng.

FieldTypeMô tả
idinteger (PK)Auto-increment
uidstring (FK)Schema node liên quan
typestringHook type: onCollectionDestroy, onSelfCreate, onSelfDestroy...
collectionstringTên collection trigger (cho onCollectionDestroy, onCollectionFieldDestroy)
fieldstringTên field trigger (cho onCollectionFieldDestroy)
methodstringTên method built-in hoặc custom để thực thi
paramsjsonTham số truyền vào method

uiButtonSchemasRoles

Bảng junction M2M giữa uiSchemas (button/action schemas) và roles. Kiểm soát role nào thấy button nào.

FieldTypeMô tả
schemaXUidstring (FK)uiSchemas.x-uid
roleNamestring (FK)roles.name

Khi roles:check trả về, button schema không có trong binding sẽ nằm trong uiButtonSchemasBlacklist.