Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(teams): add jacketNr to team model #132

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/telraam/database/models/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Team {
private Integer id;
private String name;
private Integer batonId;
private Integer jacketNr;
private String jacketNr = "0";
NuttyShrimp marked this conversation as resolved.
Show resolved Hide resolved

public Team(String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
alter table team add jacket_nr integer default 0 not null;
alter table team add jacket_nr varchar(255) default '0' not null;
4 changes: 2 additions & 2 deletions src/test/java/telraam/database/daos/TeamDAOTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ void testUpdateDoesUpdate() {
int testid = teamDAO.insert(testTeam);
testTeam.setId(testid);
testTeam.setName("postupdate");
testTeam.setJacketNr(10);
testTeam.setJacketNr("10");
int updatedRows = teamDAO.update(testid, testTeam);
assertEquals(1, updatedRows);

Optional<Team> dbTeam = teamDAO.getById(testid);
assertFalse(dbTeam.isEmpty());
assertEquals("postupdate", dbTeam.get().getName());
assertEquals(10, dbTeam.get().getJacketNr());
assertEquals("10", dbTeam.get().getJacketNr());
}

@Test
Expand Down
Loading