# AI漫画辅助应用数据库设计

## _User (Parse内置表)
- **objectId**: String (主键)
- **username**: String
- **email**: String
- **password**: String
- **authData**: Object
- **emailVerified**: bool
- **createdAt**: Date
- **updatedAt**: Date

## ComicPlan (漫画计划)
- **objectId**: String (主键)
- **planName**: String
- **description**: String
- **coverImage**: Parse.File
- **totalTasks**: Number
- **completedTasks**: Number
- **status**: 
  - draft (草稿)
  - active (进行中)
  - completed (已完成)
  - archived (已归档)
- **difficulty**:
  - beginner (初级)
  - intermediate (中级)
  - advanced (高级)
- **tags**: Array<String>
- **creator**: Pointer<_User>
- **dueDate**: Date
- **createdAt**: Date
- **updatedAt**: Date

## ComicTask (漫画任务)
- **objectId**: String (主键)
- **taskName**: String
- **description**: String
- **step**: Number (步骤序号)
- **type**:
  - storyboard (分镜设计)
  - sketch (草图绘制)
  - lineart (线稿)
  - coloring (上色)
  - lettering (文字添加)
  - review (审核)
- **referenceImages**: Array<Parse.File>
- **aiFeedback**: Object (AI反馈数据)
- **isCompleted**: bool
- **priority**: Number (1-5)
- **estimatedHours**: Number
- **actualHours**: Number
- **plan**: Pointer<ComicPlan>
- **assignee**: Pointer<_User>
- **startDate**: Date
- **endDate**: Date
- **createdAt**: Date
- **updatedAt**: Date

## 表关系
- _User 1 → n ComicPlan (创建关系)
- _User 1 → n ComicTask (分配关系)
- ComicPlan 1 → n ComicTask (包含关系)

## 关键索引
- ComicPlan_creator_status (creator, status)
- ComicTask_plan_step (plan, step)
- ComicTask_assignee_completed (assignee, isCompleted)

## 业务场景
- **创建计划**:
  - 设置planName/difficulty
  - 关联creator用户
- **添加任务**:
  - 指定type/step
  - 关联plan和assignee
  - 更新计划任务计数
- **AI反馈**:
  - 存储suggestions/score
  - 关联reference