43 lines
3.3 KiB
JSON
43 lines
3.3 KiB
JSON
{
|
||
"summary": [
|
||
"pbl_domain_ref",
|
||
"world/scene/entity 薄扩展关联表(M8,不改基表)",
|
||
"id",
|
||
"记录复用平台 world/scene/entity 基表记录与 PBL 租户/蓝图/班级/团队的关联;基表无 tenant_id,PBL 多租户隔离由本表补齐。UNIQUE(tenant_id,ref_type,ref_id)。权威 DDL:data-model.md §J1;表总账:pbls_spec.json tables_by_module.pbl_domain_ext=1、tables_total=36。"
|
||
],
|
||
"fields": [
|
||
{"name": "id", "type": "bigint", "primary": true, "autoincr": true, "notnull": true, "comment": "主键"},
|
||
{"name": "tenant_id", "type": "varchar(64)", "notnull": true, "comment": "租户ID(PBL 多租户隔离维度,基表无此列)"},
|
||
{"name": "ref_type", "type": "varchar(32)", "notnull": true, "comment": "appcodes:pbl_domain_ref_type(world/scene/entity)"},
|
||
{"name": "ref_id", "type": "bigint", "notnull": true, "comment": "复用基表记录ID(world.id / scene.id / entity.id)"},
|
||
{"name": "blueprint_id", "type": "varchar(64)", "notnull": false, "comment": "关联蓝图ID(pbl_compiler apply_game_definition 落库后回写)"},
|
||
{"name": "class_id", "type": "varchar(64)", "notnull": false, "comment": "关联教学班ID(pbl_governance.pbl_class)"},
|
||
{"name": "team_id", "type": "varchar(64)", "notnull": false, "comment": "关联团队ID(pbl_governance.pbl_team,共享世界成员分组)"},
|
||
{"name": "ext", "type": "json", "notnull": false, "comment": "扩展属性(JSON,薄扩展附加维度,禁止改基表结构)"},
|
||
{"name": "is_deleted", "type": "tinyint", "notnull": true, "default": "0", "comment": "软删标记:0=有效 1=已解绑(unbind_ref 置 1)"},
|
||
{"name": "created_at", "type": "timestamp", "notnull": true, "default": "CURRENT_TIMESTAMP", "comment": "创建时间"},
|
||
{"name": "updated_at", "type": "timestamp", "notnull": true, "default": "CURRENT_TIMESTAMP", "comment": "更新时间(ON UPDATE CURRENT_TIMESTAMP)"}
|
||
],
|
||
"indexes": [
|
||
{"name": "PRIMARY", "fields": ["id"], "unique": true, "primary": true},
|
||
{"name": "uk_pbl_domain_ref", "fields": ["tenant_id", "ref_type", "ref_id"], "unique": true, "comment": "设计 §2:UNIQUE(tenant_id,ref_type,ref_id)"},
|
||
{"name": "idx_pbl_domain_ref_bp", "fields": ["tenant_id", "blueprint_id"], "unique": false, "comment": "按蓝图查关联(compiler/analytics)"},
|
||
{"name": "idx_pbl_domain_ref_class", "fields": ["tenant_id", "class_id"], "unique": false, "comment": "按教学班查关联(F-AS-03 班级维度)"},
|
||
{"name": "idx_pbl_domain_ref_team", "fields": ["tenant_id", "team_id"], "unique": false, "comment": "按团队查关联(US-13 共享世界分组)"},
|
||
{"name": "idx_pbl_domain_ref_type", "fields": ["ref_type", "ref_id"], "unique": false, "comment": "悬挂引用一致性检查(左连接基表)"}
|
||
],
|
||
"codes": [
|
||
{
|
||
"code": "pbl_domain_ref_type",
|
||
"name": "域扩展关联类型",
|
||
"owner": "pbl_appcodes",
|
||
"items": [
|
||
{"value": "world", "label": "世界(复用基表 world)"},
|
||
{"value": "scene", "label": "场景(复用基表 scene)"},
|
||
{"value": "entity", "label": "实体(复用基表 entity)"}
|
||
],
|
||
"note": "编码由 pbl_appcodes 模块幂等注入,本模块只读引用,不重复写入编码表"
|
||
}
|
||
]
|
||
}
|