From 42019e5035ff6f845dbdb301ea1af462a8685831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 14 Jun 2026 17:12:06 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20normalize=20West=20Germany=20=E2=86=92?= =?UTF-8?q?=20Germany=20in=20sync=20script=20and=20repair=20existing=20dat?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openfootball uses 'West Germany' for 1954–1990 era matches. All DB references (matches, goals, group_standings, squads) have been merged into the Germany team on both local and VPS. TEAM_ALIASES map prevents re-creation on re-sync. Co-Authored-By: Claude Sonnet 4.6 --- scripts/sync.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/sync.ts b/scripts/sync.ts index cbaeb19..3c35674 100644 --- a/scripts/sync.ts +++ b/scripts/sync.ts @@ -166,9 +166,14 @@ async function run() { CREATE UNIQUE INDEX IF NOT EXISTS squads_unique ON squads (tournament_year, team_id, shirt_number); `) + const TEAM_ALIASES: Record = { + 'West Germany': 'Germany', + } + const teamCache = new Map() - async function upsertTeam(name: string, extra?: { iso2?: string; fifaCode?: string; continent?: string; confederation?: string }) { + async function upsertTeam(rawName: string, extra?: { iso2?: string; fifaCode?: string; continent?: string; confederation?: string }) { + const name = TEAM_ALIASES[rawName] ?? rawName if (teamCache.has(name)) return teamCache.get(name)! const iso2 = extra?.iso2 ?? getIso(name) const [row] = await db.execute(sql`