From 77dbe259f0ae3a9236a6773d8491b7b29e2b7237 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 9 Oct 2018 12:03:00 +0100 Subject: [PATCH] Added index to Observation dates. --- .../src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt index 6f59dcd..ad100eb 100644 --- a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt +++ b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt @@ -40,6 +40,7 @@ enum class RatingCategory { } @Entity +@Table(indexes = [Index(name = "dateIndex", columnList = "date")]) data class Observation( @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -47,7 +48,7 @@ data class Observation( @JsonIgnore @ManyToOne val site: Site, - @Column(nullable = false) + @Column(nullable = false, name = "date") val date: LocalDate, @Column(nullable = false) val type: TrainingType,