Skip to content

Commit

Permalink
Merge f440252 into e663713
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Aug 24, 2019
2 parents e663713 + f440252 commit 99f8e72
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_install:
install:
- git clone https://github.com/FAForever/faf-stack.git faf-stack
&& pushd faf-stack
&& git checkout 03b2fd4
&& git checkout 33a24b3
&& cp -r config.template config
&& ./scripts/init-db.sh
&& popd
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/faforever/api/data/domain/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.yahoo.elide.annotation.Include;
import com.yahoo.elide.annotation.UpdatePermission;
import lombok.Setter;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Immutable;
import org.jetbrains.annotations.Nullable;

Expand All @@ -19,6 +20,7 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -114,8 +116,10 @@ public List<GameReview> getReviews() {
return reviews;
}

@OneToOne(mappedBy = "game")
@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
@UpdatePermission(expression = "Prefab.Role.All")
@BatchSize(size = 1000)
public GameReviewsSummary getReviewsSummary() {
return reviewsSummary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

Expand Down Expand Up @@ -58,8 +56,7 @@ public float getLowerBound() {
return lowerBound;
}

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "game_id", insertable = false, updatable = false)
@OneToOne(mappedBy = "reviewsSummary")
@BatchSize(size = 1000)
public Game getGame() {
return game;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/faforever/api/data/domain/Rating.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


import lombok.Setter;
import org.hibernate.annotations.Formula;

import javax.persistence.Column;
import javax.persistence.FetchType;
Expand Down Expand Up @@ -46,7 +45,7 @@ public Player getPlayer() {
return player;
}

@Formula("mean - 3 * deviation")
@Column(name = "rating", updatable = false)
public double getRating() {
return rating;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ faf-api:
challonge:
key: ${CHALLONGE_KEY:}
database:
schema-version: ${DATABASE_SCHEMA_VERSION:71}
schema-version: ${DATABASE_SCHEMA_VERSION:72}
mautic:
base-url: ${MAUTIC_BASE_URL:false}
client-id: ${MAUTIC_CLIENT_ID:false}
Expand Down

0 comments on commit 99f8e72

Please sign in to comment.