From dc430e9cf4ad3c6e9cabcf8c33d5bcd721d1dc03 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Fri, 31 Oct 2025 11:02:43 +0100 Subject: [PATCH 1/2] Add index on start_date and end_date columns in announcement table Signed-off-by: Franck LECUYER --- .../changesets/changelog_20251031T110224Z.xml | 13 +++++++++++++ .../resources/db/changelog/db.changelog-master.yaml | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml diff --git a/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml b/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml new file mode 100644 index 0000000..98cc4d2 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index a4449ba..c22dfdf 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -35,3 +35,6 @@ databaseChangeLog: - include: file: changesets/changelog_20250820T000000Z.xml relativeToChangelogFile: true + - include: + file: changesets/changelog_20251031T110224Z.xml + relativeToChangelogFile: true From 2643cdaff85e8ea5a49e83b4d1ae5fc46cc2e3a0 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Mon, 3 Nov 2025 16:30:34 +0100 Subject: [PATCH 2/2] Add JPA annotation for the index creation on AnnouncementEntity Create only one index for both columns start_date and end_date Signed-off-by: Franck LECUYER --- .../useradmin/server/entity/AnnouncementEntity.java | 2 +- .../changelog/changesets/changelog_20251031T110224Z.xml | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gridsuite/useradmin/server/entity/AnnouncementEntity.java b/src/main/java/org/gridsuite/useradmin/server/entity/AnnouncementEntity.java index 62c1d26..388f635 100644 --- a/src/main/java/org/gridsuite/useradmin/server/entity/AnnouncementEntity.java +++ b/src/main/java/org/gridsuite/useradmin/server/entity/AnnouncementEntity.java @@ -22,7 +22,7 @@ @Getter @Setter @Entity -@Table(name = "announcement") +@Table(name = "announcement", indexes = @Index(name = "start_end_date_index", columnList = "startDate, endDate")) public class AnnouncementEntity { @Id diff --git a/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml b/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml index 98cc4d2..ae19e06 100644 --- a/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml +++ b/src/main/resources/db/changelog/changesets/changelog_20251031T110224Z.xml @@ -1,12 +1,8 @@ - - + + - - - -