feat(diary): 添加 15 个 SeaORM 实体和数据库迁移 (Phase B1)
实体: - journal_entry: 日记核心表 (心情/天气/标签/版本) - journal_element: 日记元素 (文字/图片/贴纸/手写/胶带) - handwriting_stroke: 手写笔画 (独立大字段表) - school_class: 班级 (6位码/过期控制) - class_member: 班级成员 (复合PK) - topic_assignment: 主题布置 - comment: 老师点评 - sticker_pack + sticker: 贴纸包和贴纸 - template: 日记模板 - achievement + user_achievement: 成就系统 - parent_child_binding: 家长-孩子绑定 (PIPL) - teacher_profile: 老师档案 - user_settings: 用户设置 迁移 (000170-000184): - 15 个建表迁移 + 索引 + RLS 策略 + 种子数据 - 所有表含 tenant_id 多租户隔离 - 软删除 + 乐观锁版本号 - 外键级联删除 - 暖记权限注册到基座 permissions 表 验证: cargo check 通过, 425 个测试全通过
This commit is contained in:
@@ -55,6 +55,21 @@ mod m20260504_000106_create_api_clients;
|
||||
mod m20260513_000144_enforce_version_optimistic_lock;
|
||||
mod m20260518_000149_fix_admin_permissions;
|
||||
mod m20260529_000169_supplement_rls_for_new_tables;
|
||||
mod m20260531_000170_create_journal_entries;
|
||||
mod m20260531_000171_create_journal_elements;
|
||||
mod m20260531_000172_create_handwriting_strokes;
|
||||
mod m20260531_000173_create_school_classes;
|
||||
mod m20260531_000174_create_class_members;
|
||||
mod m20260531_000175_create_topic_assignments;
|
||||
mod m20260531_000176_create_comments;
|
||||
mod m20260531_000177_create_sticker_packs;
|
||||
mod m20260531_000178_create_templates;
|
||||
mod m20260531_000179_create_achievements;
|
||||
mod m20260531_000180_create_parent_child_bindings;
|
||||
mod m20260531_000181_create_teacher_profiles;
|
||||
mod m20260531_000182_create_user_settings;
|
||||
mod m20260531_000183_diary_indexes_and_fts;
|
||||
mod m20260531_000184_diary_seed_data;
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
@@ -115,6 +130,22 @@ impl MigratorTrait for Migrator {
|
||||
Box::new(m20260513_000144_enforce_version_optimistic_lock::Migration),
|
||||
Box::new(m20260518_000149_fix_admin_permissions::Migration),
|
||||
Box::new(m20260529_000169_supplement_rls_for_new_tables::Migration),
|
||||
// --- 暖记 (Warm Notes) 迁移 ---
|
||||
Box::new(m20260531_000170_create_journal_entries::Migration),
|
||||
Box::new(m20260531_000171_create_journal_elements::Migration),
|
||||
Box::new(m20260531_000172_create_handwriting_strokes::Migration),
|
||||
Box::new(m20260531_000173_create_school_classes::Migration),
|
||||
Box::new(m20260531_000174_create_class_members::Migration),
|
||||
Box::new(m20260531_000175_create_topic_assignments::Migration),
|
||||
Box::new(m20260531_000176_create_comments::Migration),
|
||||
Box::new(m20260531_000177_create_sticker_packs::Migration),
|
||||
Box::new(m20260531_000178_create_templates::Migration),
|
||||
Box::new(m20260531_000179_create_achievements::Migration),
|
||||
Box::new(m20260531_000180_create_parent_child_bindings::Migration),
|
||||
Box::new(m20260531_000181_create_teacher_profiles::Migration),
|
||||
Box::new(m20260531_000182_create_user_settings::Migration),
|
||||
Box::new(m20260531_000183_diary_indexes_and_fts::Migration),
|
||||
Box::new(m20260531_000184_diary_seed_data::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user