fix: 修正精油名称 西洋蓍草→西洋蓍草石榴籽, 元气→元气焕能
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 8s
Test / e2e-test (push) Failing after 7m5s

defaults.json和数据库迁移同步更新,修复居家呵护套装少匹配1-2个油的问题。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 22:50:16 +00:00
parent c2369e9bee
commit 1c1f91012d
2 changed files with 49 additions and 41 deletions

View File

@@ -251,6 +251,14 @@ def init_db():
if "volume" not in cols:
c.execute("ALTER TABLE recipes ADD COLUMN volume TEXT DEFAULT ''")
# Migration: rename oils 西洋蓍草→西洋蓍草石榴籽, 元气→元气焕能
_oil_renames = [("西洋蓍草", "西洋蓍草石榴籽"), ("元气", "元气焕能")]
for old_name, new_name in _oil_renames:
exists = c.execute("SELECT 1 FROM oils WHERE name = ?", (old_name,)).fetchone()
if exists:
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))
# Seed admin user if no users exist
count = c.execute("SELECT COUNT(*) FROM users").fetchone()[0]
if count == 0: