pbl_domain_ext/models/pbl_scene_ref.json
2026-09-18 00:05:05 +08:00

30 lines
2.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"summary": "PBL 场景关联表(薄扩展):把基表 scene 绑定到 PBL 租户/班级/团队 + world 父级归属,不改 scene 基表结构Q-OPEN-3",
"tblname": "pbl_scene_ref",
"fields": [
{"name": "id", "type": "bigint", "primary": true, "auto": true, "comment": "主键"},
{"name": "tenant_id", "type": "varchar(64)", "null": false, "comment": "PBL 租户ID强制打头"},
{"name": "scene_id", "type": "bigint", "null": false, "comment": "基表 scene.id只读引用不建外键"},
{"name": "world_id", "type": "bigint", "null": false, "default": 0, "comment": "父级归属 world.id0=未指定"},
{"name": "class_id", "type": "bigint", "null": false, "default": 0, "comment": "归属班级 pbl_class.id"},
{"name": "team_id", "type": "bigint", "null": false, "default": 0, "comment": "归属团队 pbl_team.id"},
{"name": "visibility", "type": "varchar(16)", "null": false, "default": "team", "comment": "可见性 team/class/tenant"},
{"name": "role_code", "type": "varchar(64)", "null": false, "default": "", "comment": "角色绑定,空=通用"},
{"name": "source", "type": "varchar(32)", "null": false, "default": "manual", "comment": "来源 manual/compiler/import"},
{"name": "ext_json", "type": "text", "null": true, "comment": "PBL 侧扩展属性 JSON"},
{"name": "created_by", "type": "varchar(64)", "null": true, "comment": "创建人"},
{"name": "created_at", "type": "datetime", "null": false, "default": "CURRENT_TIMESTAMP", "comment": "创建时间"},
{"name": "updated_at", "type": "datetime", "null": true, "comment": "更新时间"}
],
"indexes": [
{"name": "uk_pbl_scene_ref", "unique": true, "fields": ["tenant_id", "scene_id", "team_id", "role_code"], "comment": "幂等唯一键"},
{"name": "idx_pbl_scene_ref_world", "unique": false, "fields": ["tenant_id", "world_id"], "comment": "按世界查场景"},
{"name": "idx_pbl_scene_ref_class", "unique": false, "fields": ["tenant_id", "class_id"], "comment": "按班级查"},
{"name": "idx_pbl_scene_ref_team", "unique": false, "fields": ["tenant_id", "team_id"], "comment": "按团队查"}
],
"codes": {
"visibility": {"team": "团队可见", "class": "班级可见", "tenant": "租户可见"},
"source": {"manual": "人工绑定", "compiler": "Compiler 物化", "import": "批量导入"}
}
}