feat(家庭成员): 添加家庭成员模型并关联感悟和计划

添加家庭成员模型(FamilyMember)并关联到感悟记录(InsightRecord)和今日计划(TodayPlan)
修改相关表单、视图和模板以支持发言人功能
添加数据库迁移文件和初始化脚本
更新报告模板显示发言人信息
This commit is contained in:
2026-01-23 20:35:30 +08:00
parent 5f9bd7da3e
commit 004f528c7f
7 changed files with 109 additions and 11 deletions

22
update_db.py Normal file
View File

@@ -0,0 +1,22 @@
import sqlite3
conn = sqlite3.connect('db.sqlite3')
cursor = conn.cursor()
cursor.execute('''
INSERT INTO core_familymember (name, created_at, updated_at)
VALUES ('默认成员', datetime('now', 'localtime'), datetime('now', 'localtime'));
''')
cursor.execute('''
ALTER TABLE core_insightrecord ADD COLUMN speaker_id INTEGER NOT NULL DEFAULT 1;
''')
cursor.execute('''
ALTER TABLE core_todayplan ADD COLUMN speaker_id INTEGER NOT NULL DEFAULT 1;
''')
conn.commit()
conn.close()
print("Database updated successfully!")