Giao diện
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...).
| Field | Type | Mô tả |
|---|---|---|
x-uid | string (PK) | UID duy nhất, sinh tự động |
name | string | Tên schema node (property key trong parent) |
schema | json | Magic attribute — merge/tách tự động khi đọc/ghi |
Khi đọc, schema JSON được merge với name và x-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.
| Field | Type | Mô tả |
|---|---|---|
ancestor | string (FK) | UID schema tổ tiên |
descendant | string (FK) | UID schema con cháu |
depth | integer | Khoảng cách: 0 = self, 1 = con trực tiếp |
type | string | Phân loại quan hệ |
sort | integer | Thứ tự sắp xếp siblings |
Composite PK: (ancestor, descendant)
uiSchemaTemplates
Lưu template schema tái sử dụng.
| Field | Type | Mô tả |
|---|---|---|
key | string (PK) | Unique key |
name | string | Tên hiển thị |
componentName | string | Component chính (VD: TableBlockProvider, FormV2) |
collectionName | string | Collection context (nếu template gắn collection) |
dataSourceKey | string | Data source context |
uid | string (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.
| Field | Type | Mô tả |
|---|---|---|
id | integer (PK) | Auto-increment |
uid | string (FK) | Schema node liên quan |
type | string | Hook type: onCollectionDestroy, onSelfCreate, onSelfDestroy... |
collection | string | Tên collection trigger (cho onCollectionDestroy, onCollectionFieldDestroy) |
field | string | Tên field trigger (cho onCollectionFieldDestroy) |
method | string | Tên method built-in hoặc custom để thực thi |
params | json | Tham 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.
| Field | Type | Mô tả |
|---|---|---|
schemaXUid | string (FK) | uiSchemas.x-uid |
roleName | string (FK) | roles.name |
Khi roles:check trả về, button schema không có trong binding sẽ nằm trong uiButtonSchemasBlacklist.