# 数据库初始化说明

第一阶段使用 MySQL 8.4 LTS。正式建表脚本围绕以下分组展开：

- 任务组：`ocr_task`、`ocr_task_event`、`ocr_batch`
- 文件组：`ocr_file`、`ocr_file_object`、`ocr_visual_asset`
- 文档组：`ocr_document`、`ocr_page`、`ocr_text_block`、`ocr_table_block`、`ocr_key_value`
- 引擎组：`ocr_engine`、`ocr_engine_endpoint`、`ocr_engine_strategy`、`ocr_engine_call`
- 表单组：`form_template`、`form_field`、`field_alias`、`field_dictionary`、`fill_mapping`
- 校验组：`review_task`、`review_record`
- 评估组：`evaluation_set`、`evaluation_case`、`ground_truth`、`evaluation_run`
- 系统组：`sys_user`、`sys_role`、`api_client`、`audit_log`

当前首版迁移脚本位于 `backend/src/main/resources/db/migration/V1__initial_schema.sql`，已经覆盖任务、文件、文本块、键值对、表单模板和字段映射的最小闭环。
