diff --git a/database/scores/teams.js b/database/scores/teams.js index 8d9858b..53450fd 100644 --- a/database/scores/teams.js +++ b/database/scores/teams.js @@ -19,4 +19,12 @@ async function create(name, sportID) { RETURNING team_id;`; const id = (await database.executeQuery(query, [name, sportID]))[0][0]; return new Team(id, name); +} + +async function rename(id, name) { + query = `UPDATE scores.teams + SET team_name = $2 + WHERE team_id = $1;`; + await database.executeQuery(query, [id, name]); + return new Team(id, name); } \ No newline at end of file