Skip to content

Commit 28128cc

Browse files
committed
Add replay available flag to Game entity.
Also db v111 compatibility
1 parent d19da22 commit 28128cc

6 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22
on: [push]
33
env:
44
FLYWAY_VERSION: 7.5.4
5-
FAF_DB_VERSION: v108
5+
FAF_DB_VERSION: v111
66
jobs:
77
test:
88
runs-on: ubuntu-latest

‎.idea/compiler.xml‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/inttest/java/com/faforever/api/data/GameElideTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public void filterExistingGameByVictoryCondition() throws Exception {
2727
)
2828
.andExpect(status().isOk())
2929
.andExpect(jsonPath("$.data[*]", hasSize(1)))
30-
.andExpect(jsonPath("$.data[0].attributes.victoryCondition", is("DEMORALIZATION")));
30+
.andExpect(jsonPath("$.data[0].attributes.victoryCondition", is("DEMORALIZATION")))
31+
.andExpect(jsonPath("$.data[0].attributes.replayAvailable", is(false)));
3132
}
3233

3334
@Test
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
INSERT INTO game_stats (id, startTime, gameName, gameType, gameMod, `host`, mapId, validity) VALUES
2-
(1, NOW(), 'Test game', '0', 6, 1, 1, 0);
1+
INSERT INTO game_stats (id, startTime, gameName, gameType, gameMod, `host`, mapId, validity, replay_available)
2+
VALUES (1, NOW(), 'Test game', '0', 6, 1, 1, 0, false);

‎src/main/java/com/faforever/api/data/domain/Game.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class Game {
5151
private String replayUrl;
5252
private Set<GameReview> reviews;
5353
private GameReviewsSummary reviewsSummary;
54+
private Boolean replayAvailable;
5455

5556
@Id
5657
@Column(name = "id")
@@ -136,6 +137,11 @@ public GameReviewsSummary getReviewsSummary() {
136137
return reviewsSummary;
137138
}
138139

140+
@Column(name = "replay_available")
141+
public Boolean isReplayAvailable() {
142+
return replayAvailable;
143+
}
144+
139145
/**
140146
* This ManyToOne relationship leads to a double left outer join through Elide causing an additional full table
141147
* scan on the matchmaker_queue table. Even though it has only 3 records, it causes MySql 5.7 and MySQL to run

‎src/main/resources/config/application.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ faf-api:
99
challonge:
1010
key: ${CHALLONGE_KEY:}
1111
database:
12-
schema-version: ${DATABASE_SCHEMA_VERSION:108}
12+
schema-version: ${DATABASE_SCHEMA_VERSION:111}
1313
mautic:
1414
base-url: ${MAUTIC_BASE_URL:false}
1515
client-id: ${MAUTIC_CLIENT_ID:false}

0 commit comments

Comments
 (0)