Add better indexes on ipLog and punishments

This commit is contained in:
Colin McDonald 2016-05-27 16:34:18 -04:00
parent 4bf36447b2
commit afa31fb8b6
2 changed files with 14 additions and 6 deletions

View File

@ -4,15 +4,19 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import net.frozenorb.apiv3.APIv3;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.*;
import java.util.Date;
import java.util.UUID;
@Entity(value = "ipLog", noClassnameStored = true)
@AllArgsConstructor
@Indexes(
@Index(fields = {
@Field("user"),
@Field("userIp")
})
)
public final class IPLogEntry {
@Getter @Id private String id;

View File

@ -7,9 +7,7 @@ import net.frozenorb.apiv3.actors.Actor;
import net.frozenorb.apiv3.actors.ActorType;
import net.frozenorb.apiv3.utils.TimeUtils;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.*;
import java.util.Date;
import java.util.Map;
@ -17,6 +15,12 @@ import java.util.UUID;
@Entity(value = "punishments", noClassnameStored = true)
@AllArgsConstructor
@Indexes(
@Index(fields = {
@Field("user"),
@Field("type")
})
)
public final class Punishment {
@Getter @Id private String id;