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: if "volume" not in cols:
c.execute("ALTER TABLE recipes ADD COLUMN volume TEXT DEFAULT ''") 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 # Seed admin user if no users exist
count = c.execute("SELECT COUNT(*) FROM users").fetchone()[0] count = c.execute("SELECT COUNT(*) FROM users").fetchone()[0]
if count == 0: if count == 0:

View File

@@ -328,11 +328,11 @@
"bottlePrice": 110, "bottlePrice": 110,
"dropCount": 280 "dropCount": 280
}, },
"西洋蓍草": { "西洋蓍草石榴籽": {
"bottlePrice": 450, "bottlePrice": 450,
"dropCount": 280 "dropCount": 280
}, },
"元气": { "元气焕能": {
"bottlePrice": 230, "bottlePrice": 230,
"dropCount": 280 "dropCount": 280
}, },
@@ -514,7 +514,7 @@
"drops": 1 "drops": 1
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 1 "drops": 1
}, },
{ {
@@ -797,7 +797,7 @@
"drops": 1 "drops": 1
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 1 "drops": 1
}, },
{ {
@@ -867,7 +867,7 @@
"note": "", "note": "",
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 2 "drops": 2
}, },
{ {
@@ -929,7 +929,7 @@
"drops": 1 "drops": 1
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 2 "drops": 2
}, },
{ {
@@ -1169,7 +1169,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 20 "drops": 20
}, },
{ {
@@ -1196,7 +1196,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 20 "drops": 20
}, },
{ {
@@ -1615,7 +1615,7 @@
"drops": 20 "drops": 20
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 20 "drops": 20
}, },
{ {
@@ -1910,7 +1910,7 @@
"drops": 10 "drops": 10
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
} }
] ]
@@ -2072,7 +2072,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 5 "drops": 5
}, },
{ {
@@ -2216,7 +2216,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 5 "drops": 5
} }
] ]
@@ -2285,7 +2285,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 5 "drops": 5
}, },
{ {
@@ -2328,7 +2328,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 8 "drops": 8
}, },
{ {
@@ -2491,7 +2491,7 @@
"drops": 10 "drops": 10
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 10 "drops": 10
} }
] ]
@@ -2643,7 +2643,7 @@
"drops": 2 "drops": 2
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 2 "drops": 2
} }
] ]
@@ -2666,7 +2666,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 5 "drops": 5
}, },
{ {
@@ -2709,7 +2709,7 @@
"drops": 3 "drops": 3
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
} }
] ]
@@ -2778,7 +2778,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -2816,7 +2816,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 15 "drops": 15
}, },
{ {
@@ -2901,7 +2901,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 5 "drops": 5
}, },
{ {
@@ -3041,7 +3041,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
} }
] ]
@@ -3111,7 +3111,7 @@
"drops": 10 "drops": 10
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 5 "drops": 5
}, },
{ {
@@ -3276,7 +3276,7 @@
"drops": 8 "drops": 8
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -3858,7 +3858,7 @@
"drops": 30 "drops": 30
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 30 "drops": 30
}, },
{ {
@@ -4327,7 +4327,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 20 "drops": 20
} }
] ]
@@ -4393,7 +4393,7 @@
"drops": 3 "drops": 3
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 3 "drops": 3
}, },
{ {
@@ -4564,7 +4564,7 @@
"drops": 2 "drops": 2
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -4696,7 +4696,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
} }
] ]
@@ -4723,7 +4723,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 5 "drops": 5
}, },
{ {
@@ -4758,7 +4758,7 @@
"drops": 5 "drops": 5
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 5 "drops": 5
} }
] ]
@@ -4866,7 +4866,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -4893,7 +4893,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 20 "drops": 20
}, },
{ {
@@ -5056,7 +5056,7 @@
"tags": [], "tags": [],
"ingredients": [ "ingredients": [
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -6583,7 +6583,7 @@
"drops": 4 "drops": 4
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 4 "drops": 4
}, },
{ {
@@ -6662,7 +6662,7 @@
"drops": 4 "drops": 4
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 4 "drops": 4
}, },
{ {
@@ -6729,7 +6729,7 @@
"drops": 4 "drops": 4
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 4 "drops": 4
}, },
{ {
@@ -7051,7 +7051,7 @@
"drops": 10 "drops": 10
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 20 "drops": 20
}, },
{ {
@@ -7112,7 +7112,7 @@
"drops": 3 "drops": 3
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 3 "drops": 3
} }
] ]
@@ -7588,7 +7588,7 @@
"drops": 10 "drops": 10
}, },
{ {
"oil": "西洋蓍草", "oil": "西洋蓍草石榴籽",
"drops": 10 "drops": 10
}, },
{ {
@@ -7819,7 +7819,7 @@
"drops": 2 "drops": 2
}, },
{ {
"oil": "元气", "oil": "元气焕能",
"drops": 3 "drops": 3
}, },
{ {