fix(db): correct user.update target table

stmt.user.update was issuing UPDATE guilds instead of UPDATE users,
so any DB.user.update() call would silently corrupt guild rows that
happened to share the same WHERE clause shape and never touch the
intended user row.
This commit is contained in:
Claude Owner
2026-05-26 14:38:09 +09:00
parent 9288127561
commit 7b56d2e055

View File

@@ -55,7 +55,7 @@ const stmt = {
update: (data: UserType) => {
const keys = Object.keys(data).filter(k => k !== "guild_id" && k !== "id");
if (keys.length === 0) throw new Error("update: 키1개는 있어야함");
return database.prepare(`UPDATE guilds SET ${
return database.prepare(`UPDATE users SET ${
keys.map(k => `${k} = @${k}`).join(", ")
} WHERE guild_id = @guild_id AND id = @id`).run(data);
},