fix: 配方名去除前缀数字,细胞律动统一为 细胞律动-XX系统 格式
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 10s
Test / e2e-test (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 23:23:51 +00:00
parent a8bbe77c0e
commit ef87148872

View File

@@ -264,6 +264,21 @@ def init_db():
c.execute("UPDATE oils SET name = ? WHERE name = ?", (new_name, old_name))
c.execute("UPDATE recipe_ingredients SET oil_name = ? WHERE oil_name = ?", (new_name, old_name))
# Migration: clean up recipe names — remove leading numbers, normalize 细胞律动 format
_recipe_renames = {
"2、神经系统细胞律动": "细胞律动-神经系统",
"3、消化系统细胞律动": "细胞律动-消化系统",
"4、骨骼系统细胞律动炎症控制": "细胞律动-骨骼系统(炎症控制)",
"5、淋巴系统细胞律动": "细胞律动-淋巴系统",
"6、生殖系统细胞律动": "细胞律动-生殖系统",
"7、免疫系统细胞律动": "细胞律动-免疫系统",
"8、循环系统细胞律动": "细胞律动-循环系统",
"9、内分泌系统细胞律动": "细胞律动-内分泌系统",
"12、芳香调理技术": "芳香调理技术",
}
for old_name, new_name in _recipe_renames.items():
c.execute("UPDATE recipes SET name = ? WHERE name = ?", (new_name, old_name))
# Seed admin user if no users exist
count = c.execute("SELECT COUNT(*) FROM users").fetchone()[0]
if count == 0: