Create a bilateral link between bans and ip bans

Because existing data does not have this link we're not changing our queries
to depend on this new field, it exists purely for the website/other clients. A
conversion will be ran on the database to add this field to existing ip bans.

Trello card: https://trello.com/c/os6iX7tv/5-create-a-bilateral-link-between-bans-and-ip-bans
This commit is contained in:
Colin McDonald 2016-10-16 10:25:51 -04:00
parent b71b9f957c
commit 0ca0dea102
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ public final class IpBan {
@Getter private String userIp;
@Getter private String reason;
@Getter private Instant expiresAt;
@Getter private String linkedPunishmentId;
@Getter private UUID addedBy;
@Getter private Instant addedAt;
@ -81,6 +82,7 @@ public final class IpBan {
this.userIp = userIp;
this.reason = linked.getPublicReason();
this.expiresAt = linked.getExpiresAt();
this.linkedPunishmentId = linked.getId();
this.addedBy = linked.getAddedBy();
this.addedAt = Instant.now();
this.actorName = linked.getActorName();