学生资料设置、头像与自动备份恢复。
首页卡片支持修改/删除;详情页设置 Tab 可维护学校、年级与头像;系统设置新增数据备份下载与恢复;备份默认存 /root/grade-archive-backups,详见 docs/BACKUP.md。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -101,3 +101,14 @@ def run_migrations() -> None:
|
||||
"ALTER TABLE system_settings ADD COLUMN ai_review_enabled BOOLEAN NOT NULL DEFAULT TRUE"
|
||||
)
|
||||
)
|
||||
|
||||
student_columns = {col["name"] for col in inspector.get_columns("students")}
|
||||
student_alters: list[str] = []
|
||||
if "school_name" not in student_columns:
|
||||
student_alters.append("ADD COLUMN school_name VARCHAR(128)")
|
||||
if "avatar_path" not in student_columns:
|
||||
student_alters.append("ADD COLUMN avatar_path VARCHAR(512)")
|
||||
if student_alters:
|
||||
with engine.begin() as conn:
|
||||
for clause in student_alters:
|
||||
conn.execute(text(f"ALTER TABLE students {clause}"))
|
||||
|
||||
Reference in New Issue
Block a user