entity/models/entity.json
2026-08-29 12:51:16 +08:00

34 lines
1.7 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": [
{
"table": "entity",
"title": "实体表",
"comment": "实体管理W-03",
"primary": ["id"]
}
],
"fields": [
{"name": "id", "type": "str", "length": 32, "primary": true, "comment": "主键"},
{"name": "world_id", "type": "str", "length": 32, "comment": "所属世界→world.id 逻辑关联)"},
{"name": "scene_id", "type": "str", "length": 32, "comment": "所属场景→scene.id 逻辑关联,不加物理外键)"},
{"name": "name", "type": "str", "length": 255, "comment": "实体名称"},
{"name": "code", "type": "str", "length": 64, "comment": "实体编码(唯一)"},
{"name": "entity_type", "type": "str", "length": 16, "comment": "实体类型appcodes entity_type"},
{"name": "status", "type": "str", "length": 16, "comment": "状态appcodes entity_status"},
{"name": "attributes_json", "type": "text", "comment": "属性 JSON"},
{"name": "created_at", "type": "timestamp", "comment": "创建时间"},
{"name": "updated_at", "type": "timestamp", "comment": "更新时间"}
],
"indexes": [
{"name": "idx_entity_code", "unique": true, "fields": ["code"]},
{"name": "idx_entity_world", "fields": ["world_id"]},
{"name": "idx_entity_scene", "fields": ["scene_id"]}
],
"codes": [
{"field": "world_id", "table": "world", "valuefield": "id", "textfield": "name"},
{"field": "scene_id", "table": "scene", "valuefield": "id", "textfield": "name"},
{"field": "entity_type", "table": "appcodes_kv", "cond": "parentid='entity_type'", "valuefield": "k", "textfield": "v"},
{"field": "status", "table": "appcodes_kv", "cond": "parentid='entity_status'", "valuefield": "k", "textfield": "v"}
]
}